Oracle監聽器中的XDB、XPT和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編寫的過程)的服務——容易受***
觀察監聽在數據庫每個狀態下各個服務的啓動情況和狀態:
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
鄭州婦科醫院×××:http://yyk.familydoctor.com.cn/sysdfkyy/
此時ora10g_XPT服務已經不在監聽中註冊。任務完成。
5.小結
在非Data Guard環境的Oracle 10.2版本及以上環境,我們都可以使用此方法實現禁止_XPT服務註冊到監聽器。消除一切疑惑的內容,將數據庫的運行狀態掌握在自己的手中。