pdb service管理

举报
snowofsummer 发表于 2021/03/11 09:15:26 2021/03/11
【摘要】 日常维护命令,建立和启动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')...

日常维护命令,建立和启动

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-configuri
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。