【翻译自mos文章】在Oracle单机数据库中定义database service
2017-08-02 15:13
381 查看
来源于:
Defining a Database Service with a Stand Alone Database (文档 ID 1260134.1)
Oracle Database - Enterprise Edition - Version 10.2.0.5 to 11.2.0.3 [Release 10.2 to 11.2]
Information in this document applies to any platform.
The DBMS_SERVICE package allows the creation, deletion, starting and stopping of services in both RAC and a single instance. Additionally it provides the ability to disconnect all sessions which connect to the instance
with a service name when RAC removes that service name from the instance.
The DBMS_SERVICE package lets you create, delete, activate and deactivate services for a single instance.
- Functions :
dbms_service.CREATE_SERVICE , Example:
SQL> exec dbms_service.CREATE_SERVICE(SERVICE_NAME=>'orderentry', NETWORK_NAME=>'db11g')
dbms_service.MODIFY_SERVICE , Example:
SQL> exec DBMS_SERVICE.MODIFY_SERVICE( -
> service_name => 'o11gr1', -
> goal => DBMS_SERVICE.GOAL_THROUGHPUT, -
> failover_method => DBMS_SERVICE.FAILOVER_METHOD_BASIC, -
> failover_type => DBMS_SERVICE.FAILOVER_TYPE_SELECT, -
> failover_retries => 10, -
> failover_delay => 1, -
> clb_goal => DBMS_SERVICE.CLB_GOAL_LONG);
dbms_service.START_SERVICE , Example:
SQL> exec dbms_service.START_SERVICE('orderentry')
SQL> show parameter service
It Recommended to have the LOCAL_LISTENER (Database) parameter set for the Database :
If You are using the default local address of TCP/IP, port 1521 :
alter system set LOCAL_LISTENER = '(ADDRESS=(PROTOCOL=TCP)(HOST=HOSTNAME or IP Add)(PORT=1521))' scope=spfile;
If You are using non default local address of TCP/IP, port other than 1521 :
alter system set LOCAL_LISTENER = '(ADDRESS=(PROTOCOL=TCP)(HOST=HOSTNAME or IP Add)(PORT=1522))' scope=spfile;
References:
http://docs.oracle.com/cd/E11882_01/network.112/e41945/listenercfg.htm#CHDCCHIC
dbms_service.STOP_SERVICE , Example:
SQL> exec dbms_service.STOP_SERVICE('orderentry')
dbms_service.DELETE_SERVICE , Example:
SQL> exec dbms_service.DELETE_SERVICE('orderentry')
-Monitoring
Use the following dictionary views to monitor services:
* dba_services - All defined services
* gv$active_services - All active (started) services
To see what service a session is connected to:
SELECT username, program, machine, service_name FROM gv$session;
Defining a Database Service with a Stand Alone Database (文档 ID 1260134.1)
APPLIES TO:
Oracle Database - Enterprise Edition - Version 10.2.0.5 to 11.2.0.3 [Release 10.2 to 11.2]Information in this document applies to any platform.
GOAL
The DBMS_SERVICE package allows the creation, deletion, starting and stopping of services in both RAC and a single instance. Additionally it provides the ability to disconnect all sessions which connect to the instancewith a service name when RAC removes that service name from the instance.
SOLUTION
The DBMS_SERVICE package lets you create, delete, activate and deactivate services for a single instance.- Functions :
dbms_service.CREATE_SERVICE , Example:
SQL> exec dbms_service.CREATE_SERVICE(SERVICE_NAME=>'orderentry', NETWORK_NAME=>'db11g')
dbms_service.MODIFY_SERVICE , Example:
SQL> exec DBMS_SERVICE.MODIFY_SERVICE( -
> service_name => 'o11gr1', -
> goal => DBMS_SERVICE.GOAL_THROUGHPUT, -
> failover_method => DBMS_SERVICE.FAILOVER_METHOD_BASIC, -
> failover_type => DBMS_SERVICE.FAILOVER_TYPE_SELECT, -
> failover_retries => 10, -
> failover_delay => 1, -
> clb_goal => DBMS_SERVICE.CLB_GOAL_LONG);
dbms_service.START_SERVICE , Example:
SQL> exec dbms_service.START_SERVICE('orderentry')
SQL> show parameter service
It Recommended to have the LOCAL_LISTENER (Database) parameter set for the Database :
If You are using the default local address of TCP/IP, port 1521 :
alter system set LOCAL_LISTENER = '(ADDRESS=(PROTOCOL=TCP)(HOST=HOSTNAME or IP Add)(PORT=1521))' scope=spfile;
If You are using non default local address of TCP/IP, port other than 1521 :
alter system set LOCAL_LISTENER = '(ADDRESS=(PROTOCOL=TCP)(HOST=HOSTNAME or IP Add)(PORT=1522))' scope=spfile;
References:
http://docs.oracle.com/cd/E11882_01/network.112/e41945/listenercfg.htm#CHDCCHIC
dbms_service.STOP_SERVICE , Example:
SQL> exec dbms_service.STOP_SERVICE('orderentry')
dbms_service.DELETE_SERVICE , Example:
SQL> exec dbms_service.DELETE_SERVICE('orderentry')
-Monitoring
Use the following dictionary views to monitor services:
* dba_services - All defined services
* gv$active_services - All active (started) services
To see what service a session is connected to:
SELECT username, program, machine, service_name FROM gv$session;
相关文章推荐
- 【翻译自mos文章】在Oracle单机数据库中定义database service
- 【翻译自mos文章】对于oracle 数据库来说,OGG的抽取进程什么时候到database中获取数据?
- 【翻译自mos文章】使用asm来部署 超大数据库(10TB到PB 范围)--针对oracle 10G
- 【翻译自mos文章】使用asm来部署 超大数据库(10TB到PB 范围)--针对oracle 10G
- 【翻译自mos文章】Oracle Audit Vault 和Database Firewall 12.x 的平台支持情况
- 【翻译自mos文章】将Oracle 12c数据库从标准版convert到企业版
- [翻译自MOS文章]在windows上怎么在os级别跟踪CSS以便诊断OracleCSService的问题?
- 【翻译自mos文章】在重建控制文件之后,丢失了数据库补充日志信息(Missed Database Supplemental Log Information)
- 【翻译自mos文章】Windows Service Oracleremexecservice 是干什么的
- 【翻译自mos文章】在Oracle 数据库中对SHA-2算法的支持
- 【翻译自mos文章】Oracle Database In-Memory Advisor
- 【翻译自mos文章】rac数据库中,HC_<SID>.dat文件被其他Oracle_Home下的实例所使用。
- 【从翻译mos文章】rac数据库,HC_<SID>.dat其他文件Oracle_Home用例下。
- 【翻译自mos文章】当NFS server 宕机后,Oracle 数据库 冻结并且alert 文件里没有任何错误
- 【翻译自mos文章】在12c数据库中,哪种audit trail 受到支持?
- 【翻译自mos文章】怎么检查Oracle Advanced Security Option 是否被安装上?
- 【翻译自mos文章】在数据库实例的alert日志中出现“WARNING: No cluster interconnect has been specified”
- 【翻译自mos文章】闪回区和flashback database
- 【翻译自mos文章】在db 12c 单机中不能注册ACFS为自动启动
- 【翻译自mos文章】oracle支持在RDBMS HOME 下的 符号链接( Symbolic Links)吗?