【監聽】listener.ora檔案理解
listener.ora檔案裡面配置的內容主要是靜態監聽,需要listener.ora檔案主要為了新增靜態監聽global_dbname\sid_name(SID_LIST_LISTENER)和新增額外的監聽器名稱
預設的監聽器host是hostname不是ip、埠是1521、協議是TCP,無listener.ora檔案情況下預設監聽器繼續存在(監聽器名稱預設LISTENER,host是hostname不是ip、埠是1521、協議是TCP),如果需要向非預設監聽註冊,則需要配置local_listener引數
註冊是把資料庫資訊作為一個服務註冊(註冊內容是servcice_name和instance_name)到監聽中的host和port中,listener.ora中如果host配置的資訊為ip,但是實際伺服器上不存在這個ip則無法註冊,如果host中配置的是伺服器名稱,而伺服器名稱不存在或伺服器名在/etc/hosts中對應的ip不存在或與實際IP不一致則無法註冊,DB預設監聽器的host是hostname
listener.ora中靜態監聽的SID_NAME的值一定要區分大小寫
listener.ora檔案中不會出現service_name或service_names,只有GLOBAL_DBNAME和SID_NAME,出現service_name或service_names後lsnrctl start listenername會報錯
靜態監聽如果有非預設監聽器listener以外的其他名稱的監聽器,則操作方式如下,前提是兩個監聽中的port和key不能一樣,否則也只能啟動一個。
lsnrctl start listenername
lsnrctl status listenername
lsnrctl stop listenername
安裝完資料庫軟體時預設的listener.ora如下,只有預設監聽的資訊
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = M0776)(PORT = 1521))
)
)
新增一個靜態監聽listener2後如下
LISTENER2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.98.0.31)(PORT = 1522))
)
SID_LIST_LISTENER2 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = luxus)
(ORACLE_HOME = E:\app\luxus.liao\product\11.1.0\db_1)
(SID_NAME = luxus)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = M0776)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
listener.ora想對監聽名為listener的監聽新增一個靜態註冊,只有如下內容時,是沒有靜態註冊的
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.98.0.122)(PORT = 1521))
)
)
[oracle@DEMOSFCS admin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 14-MAY-2015 20:08:31
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.98.0.122)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 14-MAY-2015 20:03:59
Uptime 0 days 0 hr. 4 min. 32 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/DEMOSFCS/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.98.0.122)(PORT=1521)))
Services Summary...
Service "DEMOSFCS" has 1 instance(s).
Instance "DEMOSFCS", status READY, has 1 handler(s) for this service...
Service "DEMOSFCSXDB" has 1 instance(s).
Instance "DEMOSFCS", status READY, has 1 handler(s) for this service...
The command completed successfully
內容是如下時(新增了SID_LIST_LISTENER資訊),才有靜態註冊
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.98.0.122)(PORT = 1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = DEMOSFCS)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
(SID_NAME = DEMOSFCS)
)
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
(PROGRAM = extproc)
)
)
[oracle@DEMOSFCS admin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 14-MAY-2015 20:08:41
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.98.0.122)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 14-MAY-2015 20:03:59
Uptime 0 days 0 hr. 4 min. 42 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/DEMOSFCS/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.98.0.122)(PORT=1521)))
Services Summary...
Service "DEMOSFCS" has 2 instance(s).
Instance "DEMOSFCS", status UNKNOWN, has 1 handler(s) for this service...
Instance "DEMOSFCS", status READY, has 1 handler(s) for this service...
Service "DEMOSFCSXDB" has 1 instance(s).
Instance "DEMOSFCS", 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
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30126024/viewspace-1846958/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle監聽檔案listener.ora for 10g/11gOracle
- 【監聽】tnsname.ora檔案理解
- Oracle 三個監聽檔案Oracle
- 監聽日誌檔案的管理
- oracle 11g 監聽檔案Oracle
- ORACLE停止監聽日誌檔案Oracle
- [zt] 理解sqlnet.ora , tnsnames.ora , Listener.ora 檔案SQL
- 深入理解監聽
- node.js監聽檔案變化Node.js
- 監聽檔案修改的四種方法
- 設定Flume監聽檔案內容
- Oracle 11g 監聽相關檔案Oracle
- tnsnames.ora監聽配置檔案詳解
- 2.5.2. 監聽程式(listener)配置——2.5.2.3. 手工編輯監聽器配置檔案
- Linux用inotify監聽檔案和目錄Linux
- WPF 實現檔案/資料夾監聽工具
- Spark Streaming監聽HDFS檔案(Spark-shell)Spark
- vue/js實現檔案流下載,檔案下載進度監聽VueJS
- 【監聽】ADR_BASE_listenername理解
- Java可以如何實現檔案變動的監聽Java
- Oracle環境變數、監聽listener.ora、tnsnames.ora、sqlnet.ora配置Oracle變數SQL
- jQuery監聽檔案上傳實現進度條效果jQuery
- Linux使用inotify-tools監聽檔案或目錄Linux
- ASM有自己的引數、密碼、alert、監聽檔案ASM密碼
- hyperf 啟動、重啟、停止、檔案變化監聽命令包
- 同一Server上兩個資料庫例項共用listener.ora ,監聽多個埠Server資料庫
- 監聽 watch props物件屬性監聽 或深度監聽物件
- Oracle LISTENER監聽檔案引數詳解及Lsnrctl命令綜述Oracle
- 動態監聽與靜態監聽
- 動態監聽和靜態監聽
- listener.ora檔案與tnsnames.ora之間的關係
- oracle 資料庫lsnrctl監聽的日誌路徑和trace檔案Oracle資料庫
- 監聽器日誌檔案(listener.log)到底記錄了些啥
- 如何更改監聽器日誌檔名稱
- 【監聽】兩庫互配靜態監聽
- ORACLE動態監聽與靜態監聽Oracle
- oracle靜態監聽和動態監聽Oracle
- 【oracle】動態監聽與靜態監聽Oracle