天天看點

pdb service管理資料庫關閉之後,建立的service不能自動啟動.啟動觸發器相關視圖:

日常維護指令,建立和啟動

SQL> EXEC DBMS_SERVICE.CREATE_SERVICE('jerome.cn.oracle.com','jerome.cn.oracle.com');

PL/SQL procedure successfully completed.


SQL> EXEC DBMS_SERVICE.START_SERVICE('jerome.cn.oracle.com');

PL/SQL procedure successfully completed.

SQL>
SQL> select NAME, NETWORK_NAME from v$services;

NAME NETWORK_NAME
------------------------------ --------------------------------------------------
orclXDB orclXDB
SYS$BACKGROUND
SYS$USERS
jerome.cn.oracle.com jerome.cn.oracle.com <<<<< New services
orcl.cn.oracle.com orcl.cn.oracle.com            

資料庫關閉之後,建立的service不能自動啟動.

查詢未啟動的service

select * from dba_services where SERVICE_ID not in (select SERVICE_ID from V$ACTIVE_SERVICES);            

啟動觸發器

create or replace trigger open_services
after startup on database
begin
DBMS_SERVICE.START_SERVICE('jerome.cn.oracle.com');
end open_services;
/            

相關視圖:

Database Service Data Dictionary Views

You can query data dictionary views to find information about database services.

You can find information about database services in the following views:

    DBA_SERVICES

    ALL_SERVICES or V$SERVICES

    V$ACTIVE_SERVICES

    V$SERVICE_STATS

    V$SERVICE_EVENT

    V$SERVICE_WAIT_CLASS

    V$SERV_MOD_ACT_STATS

    V$SERVICEMETRIC

    V$SERVICEMETRIC_HISTORY

The following additional views also contain some information about database services:

    V$SESSION

    V$ACTIVE_SESSION_HISTORY

    DBA_RSRC_GROUP_MAPPINGS

    DBA_SCHEDULER_JOB_CLASSES

    DBA_THRESHOLDS

The ALL_SERVICES view includes a GLOBAL_SERVICE column, and the V$SERVICES and V$ACTIVE_SERVICES views contain a GLOBAL column. These views and columns enable you to determine whether a database service is a global service.

Parent topic: Managing Application Workloads with Database Services
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/admin/creating-and-configuring-an-oracle-database.html#GUID-E2D6D197-0733-45D2-AE9B-98F9736DC1B8