Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4909507
  • 博文数量: 998
  • 博客积分: 8199
  • 博客等级: 中将
  • 技术积分: 13042
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-25 20:19
个人简介

脚踏实地、勇往直前!

文章分类

全部博文(998)

文章存档

2019年(88)

2018年(208)

2017年(81)

2016年(49)

2015年(50)

2014年(170)

2013年(52)

2012年(177)

2011年(93)

2010年(30)

分类: Oracle

2012-03-13 16:39:38

环境:
OS:Red Hat Linux As5
DB:10.2.0.1
 
从9i开始,启动数据库的时候会默认启动XPT(dataguard需要该服务)和XDB这两个服务,从监听器的状态中可以发现有XPT和XDB两个服务.
 
Services Summary...
Service "oracl" has 2 instance(s).
  Instance "oracl", status UNKNOWN, has 1 handler(s) for this service...
  Instance "oracl", status READY, has 1 handler(s) for this service...
Service "oraclXDB" has 1 instance(s).
  Instance "oracl", status READY, has 1 handler(s) for this service...
Service "oracl_XPT" has 1 instance(s).
  Instance "oracl", status READY, has 1 handler(s) for this service...
Service "oraclbak" has 1 instance(s).
  Instance "oraclbak", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

1.试着尝试使用dbms_service来停止和删除XDB服务.

SQL>Begin
    Dbms_Service.Disconnect_Session('oraclXDB');
    End;
    /
PL/SQL procedure successfully completed.

SQL>Begin
    dbms_service.stop_service('oraclXDB');
    End;
    /

PL/SQL procedure successfully completed.

SQL> Begin
     dbms_service.delete_service('oraclXDB');
     End;
    /
Begin
*
ERROR at line 1:
ORA-44305: service oraclXDB is running
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-06512: at "SYS.DBMS_SERVICE", line 434
ORA-06512: at "SYS.DBMS_SERVICE", line 323
ORA-06512: at line 2

从以上过程发现使用dbms_service不能停止该服务.最后多次尝试不成功的情况下使用修改dispatchers参数的方法.

 

SQL> show parameters dispatchers;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
dispatchers                          string      (PROTOCOL=TCP) (SERVICE=oraclX
                                                 DB)
max_dispatchers                      integer
SQL>


SQL> alter system set dispatchers='' scope=both;

System altered.

2.XPT服务是数据库动态注册的(pmon进程动态注册端口为1521的监听器,若想pmon动态监听到1521以外的端口需要使用alter system register注册),停止该服务将本地的监听器指向一个不存在的监听器即可,如下(监听器test并不存在):

SQL> alter system set local_listener='test' scope=both;

System altered.

或是通过设置隐含参数停止XPT服务.

alter system set "__dg_broker_service_names"='' scope=spfile;

-- The End--

阅读(2835) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~
评论热议
请登录后评论。

登录 注册