ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 【LISTENER】使用Oracle隐含参数禁止“_XPT”服务注册到监听器

【LISTENER】使用Oracle隐含参数禁止“_XPT”服务注册到监听器

原创 Linux操作系统 作者:secooler 时间:2011-08-22 23:06:55 0 删除 编辑
  在Oracle的10.2版本中,Oracle不仅会将数据库的实例注册到监听器,与此同时还会注册生成一个名为_XPT(以数据库的SID开头,以XPT结尾,中间是下划线)的服务,这个服务是用于Data Guard环境,对正常数据库连接没有影响。鉴于_XPT服务的作用,我们完全有理由取消这个注册。这里给出禁止_XPT服务注册到监听器的方法。
  我们可以通过将隐含参数“__dg_broker_service_names”内容置空的方法达到这个目的。

1.“__dg_broker_service_names”隐含参数的含义
可以通过x$ksppi和x$ksppcv获取隐含参数的当前值和说明信息。查询结果如下。
sys@ora10g> select a.ksppinm param_name,b.ksppstvl param_value,a.ksppdesc param_description from x$ksppi a,x$ksppcv b where a.indx = b.indx and a.ksppinm = '__dg_broker_service_names';

PARAM_NAME                 PARAM_VALUE   PARAM_DESCRIPTION
-------------------------- ------------- ----------------------------
__dg_broker_service_names  ora10g_XPT    service names for broker use

2.监听器状态信息
ora10g@secdb /home/oracle$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 22-AUG-2011 21:19:58

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                22-AUG-2011 21:19:12
Uptime                    0 days 0 hr. 0 min. 46 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Listener Log File         /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb.localdomain)(PORT=1521)))
Services Summary...
Service "ora10g" has 1 instance(s).
  Instance "ora10g", status READY, has 1 handler(s) for this service...
Service "ora10g_XPT" has 1 instance(s).
  Instance "ora10g", status READY, has 1 handler(s) for this service...
The command completed successfully


其中“ora10g_XPT”便是我们所提到的_XPT服务。我们的目标就是去除这个注册信息。

3.将“__dg_broker_service_names”隐含参数置空
sys@ora10g> alter system set "__dg_broker_service_names" = '';

System altered.

注意,此隐含参数为动态参数,可以直接进行调整。

4.重启监听器后查看监听状态
1)停止监听器
LSNRCTL> stop
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1521)))
The command completed successfully

2)启动监听器
LSNRCTL> start
Starting /oracle/ora10gR2/product/10.2.0/db_2/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Log messages written to /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb.localdomain)(PORT=1521)))

Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                22-AUG-2011 21:22:40
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Listener Log File         /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb.localdomain)(PORT=1521)))
The listener supports no services
The command completed successfully


3)等待数据库实例注册到监听后查看监听器状态
ora10g@secdb /home/oracle$ lsnrctl

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 22-AUG-2011 21:23:00

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> status
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                22-AUG-2011 21:22:40
Uptime                    0 days 0 hr. 0 min. 21 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/ora10gR2/product/10.2.0/db_2/network/admin/listener.ora
Listener Log File         /oracle/ora10gR2/product/10.2.0/db_2/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb.localdomain)(PORT=1521)))
Services Summary...
Service "ora10g" has 1 instance(s).
  Instance "ora10g", status READY, has 1 handler(s) for this service...
The command completed successfully


此时ora10g_XPT服务已经不在监听中注册。任务完成。

5.小结
  在非Data Guard环境的Oracle 10.2版本及以上环境,我们都可以使用此方法实现禁止_XPT服务注册到监听器。消除一切疑惑的内容,将数据库的运行状态掌握在自己的手中。

Good luck.

secooler
11.08.22

-- The End --

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/519536/viewspace-705586/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Oracle ACE 总监,阿里云MVP,北京大学理学硕士,恩墨学院创始人,教育专家,中国区 Cloudera 首位官方授权大数据讲师,金牌培训专家,BDA大数据联盟创始人,OCM联盟创始人,ACCUG创始人、ACOUG核心专家,Blogger。

注册时间:2008-03-16

  • 博文量
    797
  • 访问量
    8094109