Oracle监听器中的XDB、_XPT、_DGMGRL 、_DGB、PLSExtProc服务


Oracle监听器中的XDB、_XPT、_DGMGRL 、_DGB、PLSExtProc服务


数据库在shutdown状态下,仅有PLSExtProc服务,且处于未知状态。


数据库在nomount状态下,有SID、SIDXDB、SID_XPT、PLSExtProc服务,其中,SID、SIDXDB、SID_XPT服务处于

就绪/准备状态,PLSExtProc处于未知状态。


下面分别介绍各个服务的作用:


SID:启动数据库实例的服务

SIDXDB:高效处理XML数据的服务,默认会占用8080端口。

SID_XPT:Oracle 10g为DG准备的服务,DB BROKER会用到,如果不用DG可以删掉。

PLSExtProc:PL/SQL调用外部接口(C、JAVA编写的过程)的服务——容易受攻击

"  _DGB   ":的做用是dgmgrl直接通信用的。
"_DGMGRL" :静态监听的作用:


A static entry is needed for the Broker to be able to connect remotely to a database that has been shut down by the Broker during certain operations. They are required for the Broker to complete the following operations:

  • Switchover from the Primary database to a Physical Standby database
  • Reinstatement of failed Primary database after a manual or automatic failover has occurred.
  • Conversion of a Snapshot Standby database back to a Physical Standby database

To access a database that has been shutdown in one of the above situations, the Broker uses a default name for the static entry using the information from the LOCAL_LISTENER parameter of the instance and the keyword "_DGMGRL" and stores that information in the broker StaticConnectIdentifier property associated with each instance of the database. As a best practice, users should not change the default values assigned to the Broker StaticConnectIdentifier property or to the database LOCAL_LISTENER initialization parameter as the value of the StaticConnectIdentifier property will be automatically updated by the Broker whenever the instance specified by the SidName property is started on a different host. 


Note:  Static entries are only used by the Broker itself via the Broker defined StaticConnectIdentifier property. They are NEVER to be used for any other purpose by the user. This includes using it for the normal DGConnectIdentifier, RMAN connections or anything else. Also note that you must never define a static entry for the Broker 'DGB' service. That service is for the Broker exclusive use. Also note that using the "_DGMGRL" or "_DGB" in your TNSNAMES definition is expressly forbidden.

================

11g:


[grid@rhel6lhr admin]$ lsnrctl status LISTENER_DG
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 02-AUG-2019 09:08:29
Copyright (c) 1991, 2011, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.59.130)(PORT=1526)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_DG
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                02-AUG-2019 09:01:30
Uptime                    0 days 0 hr. 6 min. 59 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/grid/11.2.0/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/rhel6lhr/listener_dg/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.59.130)(PORT=1526)))
Services Summary...
Service "oradg11g" has 2 instance(s).
  Instance "oradg11g", status UNKNOWN, has 1 handler(s) for this service...
  Instance "oradg11g", status READY, has 1 handler(s) for this service...
Service "oradg11gXDB" has 2 instance(s).
  Instance "oradg11g", status READY, has 1 handler(s) for this service...
  Instance "oradgphy", status READY, has 1 handler(s) for this service...
Service "oradg11g_DGB" has 1 instance(s).
  Instance "oradg11g", status READY, has 1 handler(s) for this service...
Service "oradg11g_DGMGRL" has 1 instance(s).
  Instance "oradg11g", status UNKNOWN, has 1 handler(s) for this service...
Service "oradgphy" has 2 instance(s).
  Instance "oradgphy", status UNKNOWN, has 1 handler(s) for this service...
  Instance "oradgphy", status READY, has 1 handler(s) for this service...
Service "oradgphy_DGB" has 1 instance(s).
  Instance "oradgphy", status READY, has 1 handler(s) for this service...
Service "oradgphy_DGMGRL" has 1 instance(s).
  Instance "oradgphy", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[grid@rhel6lhr admin]$


10g:


Service "oradg10g" has 2 instance(s).
  Instance "oradg10g", status UNKNOWN, has 1 handler(s) for this service...
  Instance "oradg10g", status READY, has 1 handler(s) for this service...
Service "oradg10gXDB" has 1 instance(s).
  Instance "oradg10g", status READY, has 1 handler(s) for this service...
Service "oradg10g_DGB" has 1 instance(s).
  Instance "oradg10g", status READY, has 1 handler(s) for this service...
Service "oradg10g_DGMGRL" has 1 instance(s).
  Instance "oradg10g", status UNKNOWN, has 1 handler(s) for this service...
Service "oradg10g_XPT" has 1 instance(s).
  Instance "oradg10g", status READY, has 1 handler(s) for this service...
Service "orawldg" has 2 instance(s).
  Instance "orawldg", status UNKNOWN, has 1 handler(s) for this service...
  Instance "orawldg", status READY, has 1 handler(s) for this service...
Service "orawldg_DGB" has 1 instance(s).
  Instance "orawldg", status READY, has 1 handler(s) for this service...
Service "orawldg_DGMGRL" has 1 instance(s).
  Instance "orawldg", status UNKNOWN, has 1 handler(s) for this service...
Service "orawldg_XPT" has 1 instance(s).
  Instance "orawldg", status READY, has 1 handler(s) for this service...



2  Oracle Data Guard Installation

To enable DGMGRL to restart instances during the course of broker operations, a static service must be registered with the local listener of each instance. A static service registration is also required to enable the observer to restart instances as part of automatic reinstatement of the old primary database after a fast-start failover has occurred. By default, the broker assumes a static service name of db_unique_name_DGMGRL.db_domain and expects the listener has been started with the following content in the listener.ora file:

LISTENER = (DESCRIPTION =
     (ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=host_name)
     (PORT=port_num))))
SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(SID_NAME=sid_name)
     (GLOBAL_DBNAME=db_unique_name_DGMGRL.db_domain)
     (ORACLE_HOME=oracle_home)
     (ENVS="TNS_ADMIN=oracle_home/network/admin")))



观察监听在数据库每个状态下各个服务的启动情况和状态:


SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.


Services Summary...

Service "PLSExtProc" has 1 instance(s).

  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully


注:数据库在shutdown状态下,仅有PLSExtProc服务,且处于未知状态。


SQL> startup nomount;

ORACLE instance started.


Total System Global Area  826277888 bytes

Fixed Size      1222096 bytes

Variable Size    473958960 bytes

Database Buffers   348127232 bytes

Redo Buffers      2969600 bytes


Service "C2155" has 1 instance(s).

  Instance "C2155", status BLOCKED, has 1 handler(s) for this service...

Service "C2155_XPT" has 1 instance(s).

  Instance "C2155", status BLOCKED, has 1 handler(s) for this service...

Service "PLSExtProc" has 1 instance(s).

  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully


注:数据库在nomount状态下,有SID、SID_XPT、PLSExtProc服务,其中,SID、SID_XPT服务处于封锁状态,PLSExtProc处于未知状态。


SQL> alter database mount;


Database altered.


Services Summary...

Service "C2155" has 1 instance(s).

  Instance "C2155", status READY, has 1 handler(s) for this service...

Service "C2155_XPT" has 1 instance(s).

  Instance "C2155", status READY, has 1 handler(s) for this service...

Service "PLSExtProc" has 1 instance(s).

  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully


注:数据库在nomount状态下,有SID、SID_XPT、PLSExtProc服务,其中,SID、SID_XPT服务处于就绪/准备状态,PLSExtProc处于未知状态。


SQL> alter database open;


Database altered.


Services Summary...

Service "C2155" has 1 instance(s).

  Instance "C2155", status READY, has 1 handler(s) for this service...

Service "C2155XDB" has 1 instance(s).

  Instance "C2155", status READY, has 1 handler(s) for this service...

Service "C2155_XPT" has 1 instance(s).

  Instance "C2155", status READY, has 1 handler(s) for this service...

Service "PLSExtProc" has 1 instance(s).

  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully



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



在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服务注册到监听器。消除一切疑惑的内容,将数据库的运行状态掌握在自己的手中。





About Me

........................................................................................................................

● 本文作者:小麦苗,部分内容整理自网络,若有侵权请联系小麦苗删除

● 本文在itpub、博客园、CSDN和个人微 信公众号( xiaomaimiaolhr )上有同步更新

● 本文itpub地址: http://blog.itpub.net/26736162

● 本文博客园地址: http://www.cnblogs.com/lhrbest

● 本文CSDN地址: https://blog.csdn.net/lihuarongaini

● 本文pdf版、个人简介及小麦苗云盘地址: http://blog.itpub.net/26736162/viewspace-1624453/

● 数据库笔试面试题库及解答: http://blog.itpub.net/26736162/viewspace-2134706/

● DBA宝典今日头条号地址: http://www.toutiao.com/c/user/6401772890/#mid=1564638659405826

........................................................................................................................

● QQ群号: 230161599 (满) 、618766405

● 微 信群:可加我微 信,我拉大家进群,非诚勿扰

● 联系我请加QQ好友 646634621 ,注明添加缘由

● 于 2019-07-01 06:00 ~ 2019-07-31 24:00 在西安完成

● 最新修改时间:2019-07-01 06:00 ~ 2019-07-31 24:00

● 文章内容来源于小麦苗的学习笔记,部分整理自网络,若有侵权或不当之处还请谅解

● 版权所有,欢迎分享本文,转载请保留出处

........................................................................................................................

小麦苗的微店 https://weidian.com/s/793741433?wfr=c&ifr=shopdetail

小麦苗出版的数据库类丛书 http://blog.itpub.net/26736162/viewspace-2142121/

小麦苗OCP、OCM、高可用网络班 http://blog.itpub.net/26736162/viewspace-2148098/

小麦苗腾讯课堂主页 https://lhr.ke.qq.com/

........................................................................................................................

使用 微 信客户端 扫描下面的二维码来关注小麦苗的微 信公众号( xiaomaimiaolhr )及QQ群(DBA宝典)、添加小麦苗微 信, 学习最实用的数据库技术。

........................................................................................................................

欢迎与我联系

 

 



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

转载于:http://blog.itpub.net/26736162/viewspace-2652121/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值