【翻译自mos文章】在Oracle单机数据库中定义database service

来源于:

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 instance with 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;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值