【原創】Oracle的動態監聽註冊
ORACLE例項在啟動時,或使用命令ALTER SYSTEM REGISTER ,或每隔一分鐘,PMON程式會向監聽進行動態註冊
1、監聽在啟動時,會從$ORACLE_HOME/network/admin/listener.ora讀取監聽配置,如果該檔案不存在,則監聽會在主機名對應的IP和1521埠上進行監聽。可以看到監聽剛剛啟動的時候,並沒有註冊的服務
LSNRCTL> start
Starting tnslsnr: please wait...
TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
Log messages written to f:\oracle\product\10.2.0\network\log\listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linan)(PORT=1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
Start Date 14-APR-2008 21:29:40
Uptime 0 days 0 hr. 0 min. 2 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File f:\oracle\product\10.2.0\network\log\listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linan)(PORT=1521)))
The listener supports no services
The command completed successfully
2、過了大概1分鐘,PMON程式會將服務註冊進來
LSNRCTL> status
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
Start Date 14-APR-2008 21:29:40
Uptime 0 days 0 hr. 1 min. 57 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File f:\oracle\product\10.2.0\network\log\listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linan)(PORT=1521)))
Services Summary...
Service "test" has 1 instance(s).
Instance "test", status READY, has 1 handler(s) for this service...
Service "testXDB" has 1 instance(s).
Instance "test", status READY, has 1 handler(s) for this service...
Service "test_XPT" has 1 instance(s).
Instance "test", status READY, has 1 handler(s) for this service...
The command completed successfully
3、但是PMON程式只向預設的1521埠的監聽註冊,當監聽不在1521埠時,需要使用下面的方法:
a、直接在引數local_listener中輸入監聽地址,PMON程式會根據此資訊,並進行註冊
sys@TEST>alter system set local_listener='(address=(protocol=tcp)(port=1522)(host=linan))';
System altered.
b、或者只在引數local_listener中輸入監聽的名稱
sys@TEST>alter system set local_listener='test';
System altered.
在$ORACLE_HOME/network/admin/tnsnames.ora中包含監聽地址,PMON程式會從此處得監聽資訊,並進行註冊
TEST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.102)(PORT = 1522))
4、但有3點需要注意的地方:
a、PMON程式1分鐘執行一次,當監聽剛剛啟動的時候,可能服務還沒有註冊進去,這時候是不能使用此服務的
b、在修改local_listener引數時,PMON程式也會重新註冊一次
c、如果資料庫shutdown後,PMON程式也停止了,服務會從監聽中刪除,這時候只能使用OS認證的方式連入資料庫
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=linan)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias listener1
Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
Start Date 14-APR-2008 21:14:04
Uptime 0 days 0 hr. 10 min. 15 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File f:\oracle\product\10.2.0\network\admin\listener.ora
Listener Log File f:\oracle\product\10.2.0\network\log\listener1.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linan)(PORT=1522)))
Services Summary...
Service "test" has 1 instance(s).
Instance "test", status BLOCKED, has 1 handler(s) for this service...
Service "testXDB" has 1 instance(s).
Instance "test", status BLOCKED, has 1 handler(s) for this service...
Service "test_XPT" has 1 instance(s).
Instance "test", status BLOCKED, has 1 handler(s) for this service...
The command completed successfully
sys@TEST>shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=linan)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias listener1
Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
Start Date 14-APR-2008 21:14:04
Uptime 0 days 0 hr. 10 min. 49 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File f:\oracle\product\10.2.0\network\admin\listener.ora
Listener Log File f:\oracle\product\10.2.0\network\log\listener1.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linan)(PORT=1522)))
The listener supports no services
The command completed successfully
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/498744/viewspace-237817/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 動態監聽註冊Oracle
- Oracle監聽的靜態註冊和動態註冊Oracle
- Oracle監聽的動態註冊與靜態註冊Oracle
- oracle監聽靜態註冊和動態註冊Oracle
- oracle監聽動態註冊與靜態註冊Oracle
- 監聽動態註冊
- 動態註冊監聽
- 動態監聽註冊
- Oracle動態監聽註冊測試Oracle
- oracle監聽動態註冊與靜態註冊[轉帖]Oracle
- 【監聽】動態註冊和靜態註冊
- oracle監聽器動態註冊於靜態註冊的區別Oracle
- oracle監聽器的靜態和動態註冊Oracle
- oracle監聽之動態和靜態註冊Oracle
- rac監聽動態註冊
- 動態註冊監聽Listener
- ORACLE 動態註冊,靜態註冊,多個監聽,一個監聽多個埠配置Oracle
- Oracle9i中的監聽動態註冊Oracle
- oracle監聽【非1521埠】動態註冊Oracle
- rac監聽不能動態註冊
- 轉載:oracle監聽器的靜態和動態註冊Oracle
- 理解Oracle9i中的監聽動態註冊Oracle
- Oracle 靜態監聽註冊詳解Oracle
- Oracle監聽器的靜態註冊與動態註冊,以及DB_DOMAIN問題OracleAI
- HPUX 監聽無法動態註冊UX
- oracle 監聽器動態與靜態註冊服務_listenerOracle
- 理解Oracle9i中的監聽動態註冊(zt)Oracle
- 動態和靜態監聽註冊-小魚的理解
- Oracle 19C 監聽無法動態註冊例項Oracle
- oracle10.2.0.4 動態註冊監聽配置_摘自小荷Oracle
- ORACLE動態監聽與靜態監聽Oracle
- oracle靜態監聽和動態監聽Oracle
- 【oracle】動態監聽與靜態監聽Oracle
- 聊聊跟蹤監聽器動態註冊(Dynamic Register)方法
- 【LISTENER】修改 LISTENER的監聽埠為1526(動態註冊)
- Oracle Listener 動態註冊 與 靜態註冊Oracle
- Oracle listener靜態註冊和動態註冊Oracle
- Oracle Listener 動態註冊與靜態註冊Oracle