ORACLE動態監聽總結
本文件介紹ORACLE動態監聽服務的配置及原理;
$ORACLE_HOME/network/admin/listener.ora
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=1521)(host= 192.168.19.128))' scope=both;
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>shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=joeone-1)(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
監聽服務是根據listener.ora設定的埠進行監聽的,資料庫啟動的時候會預設根據1521的埠進行註冊;
如果預設的埠不是1521的話,就需要修改引數檔案的資訊;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12679300/viewspace-1156770/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE動態監聽與靜態監聽Oracle
- oracle靜態監聽和動態監聽Oracle
- 【oracle】動態監聽與靜態監聽Oracle
- oracle 監聽 靜態 動態Oracle
- Oracle 動態監聽配置Oracle
- 【listener】oracle靜態監聽和動態監聽 【轉載】Oracle
- Oracle 動態監聽註冊Oracle
- oracle動態和靜態監聽listenerOracle
- 動態監聽與靜態監聽
- 動態監聽和靜態監聽
- oracle listener 靜態監聽與動態監聽的一些小事Oracle
- Oracle動態監聽註冊測試Oracle
- oracle靜態監聽Oracle
- oracle監聽之動態和靜態註冊Oracle
- 同時配置動態監聽與靜態監聽
- oracle監聽器的靜態和動態註冊Oracle
- oracle監聽靜態註冊和動態註冊Oracle
- oracle監聽動態註冊與靜態註冊Oracle
- 【原創】Oracle的動態監聽註冊Oracle
- 預設及非預設埠的動態監聽/靜態監聽實驗彙總
- oracle之 監聽器無法啟動的幾個原因總結Oracle
- 監聽動態註冊
- 動態註冊監聽
- 動態監聽註冊
- Oracle監聽的靜態註冊和動態註冊Oracle
- Oracle監聽的動態註冊與靜態註冊Oracle
- oracle監聽【非1521埠】動態註冊Oracle
- ORACLE 動態註冊,靜態註冊,多個監聽,一個監聽多個埠配置Oracle
- 動態監聽與靜態監聽的一些特點。
- oracle監聽動態註冊與靜態註冊[轉帖]Oracle
- 轉載:oracle監聽器的靜態和動態註冊Oracle
- oracle 監聽器動態與靜態註冊服務_listenerOracle
- rac監聽動態註冊
- 動態註冊監聽Listener
- Oracle9i中的監聽動態註冊Oracle
- 【監聽】配置服務端靜態(動態)監聽/修改監聽埠及引數local_listener作用服務端
- 理解Oracle9i中的監聽動態註冊Oracle
- rac監聽不能動態註冊