【LISTENER】禁止產生監聽器日誌的方法
Oracle預設配置情況下,會不停的生成監聽器的日誌,類似於資料庫的alert日誌。監聽器的日誌預設儲存在$ORACLE_HOME/network/log/listener.log檔案中,記錄了監聽器提供服務的狀態資訊。如果監聽器的日誌一直處於無人管理的狀態下,很有可能遭遇由於監聽器日誌檔案過大導致系統空間不足的問題。
如果確認不需要監聽器日誌來輔助問題排查,可以考慮禁止生成監聽器日誌。主要有兩種實現方法,一種方法是在不需要重啟監聽器的情況下透過設定log_status引數為off來實現;另外一種方法是在listener.ora檔案中增加LOGGING_=OFF引數,然後重啟監聽器實現。
1.檢視監聽器狀態資訊
secdb@secdb /home/oracle$ lsnrctl
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 30-AUG-2011 21:19:46
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 30-AUG-2011 13:01:18
Uptime 0 days 8 hr. 18 min. 29 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
監聽資訊中記錄了Listener Log File相關資訊。
2.透過設定log_status引數為off實現禁止生成監聽器日誌
1)檢視log_status引數內容
LSNRCTL> show log_status
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1521)))
LISTENER parameter "log_status" set to ON
The command completed successfully
預設情況下log_status引數是on的狀態,表示生成監聽器日誌資訊。
2)透過調整log_status引數值為off禁止生成監聽日誌
LSNRCTL> set log_status off
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1521)))
LISTENER parameter "log_status" set to OFF
The command completed successfully
3)檢視調整結果
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 30-AUG-2011 13:01:18
Uptime 0 days 8 hr. 19 min. 52 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
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
此時監聽日誌對應的資訊已經不在。
3.設定LOGGING_=OFF引數實現禁止生成監聽器日誌
1)啟用監聽日誌寫出
使用“set log_status on”命令啟用監聽日誌功能
LSNRCTL> set log_status on
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1521)))
LISTENER parameter "log_status" set to ON
The command completed successfully
2)檢視監聽狀態
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 30-AUG-2011 13:01:18
Uptime 0 days 8 hr. 21 min. 12 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
3)在listener.ora檔案中增加“LOGGING_LISTENER=OFF”
secdb@secdb /home/oracle$ cd $ORACLE_HOME/network/admin
secdb@secdb /oracle/ora10gR2/product/10.2.0/db_2/network/admin$ vi listener.ora
listener=
(description=
(address=(protocol=tcp)(host=secdb)(port=1521)))
LOGGING_LISTENER=OFF
~
~
4)停啟監聽器使引數調整生效
secdb@secdb /oracle/ora10gR2/product/10.2.0/db_2/network/admin$ lsnrctl
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 30-AUG-2011 21:31:50
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> stop
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1521)))
The command completed successfully
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
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 30-AUG-2011 21:32:01
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
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb.localdomain)(PORT=1521)))
The listener supports no services
The command completed successfully
LSNRCTL>
調整完畢,此時監聽器狀態中已經不存在有關監聽器日誌資訊。監聽器日誌寫出已被禁用。
4.小結
本文給出了兩種禁止生成監聽日誌的方法,一種方法是在不需要重啟監聽器的情況下透過設定log_status引數為off來實現,另外一種方法是在listener.ora檔案中增加LOGGING_=OFF引數,然後重啟監聽器實現。根據實際影響範圍做好取捨。
另外,監聽日誌中記錄了大量有關監聽器的使用資訊,是否禁止產生監聽日誌請謹慎抉擇。
Good luck.
secooler
11.08.30
-- The End --
如果確認不需要監聽器日誌來輔助問題排查,可以考慮禁止生成監聽器日誌。主要有兩種實現方法,一種方法是在不需要重啟監聽器的情況下透過設定log_status引數為off來實現;另外一種方法是在listener.ora檔案中增加LOGGING_
1.檢視監聽器狀態資訊
secdb@secdb /home/oracle$ lsnrctl
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 30-AUG-2011 21:19:46
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 30-AUG-2011 13:01:18
Uptime 0 days 8 hr. 18 min. 29 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
監聽資訊中記錄了Listener Log File相關資訊。
2.透過設定log_status引數為off實現禁止生成監聽器日誌
1)檢視log_status引數內容
LSNRCTL> show log_status
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1521)))
LISTENER parameter "log_status" set to ON
The command completed successfully
預設情況下log_status引數是on的狀態,表示生成監聽器日誌資訊。
2)透過調整log_status引數值為off禁止生成監聽日誌
LSNRCTL> set log_status off
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1521)))
LISTENER parameter "log_status" set to OFF
The command completed successfully
3)檢視調整結果
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 30-AUG-2011 13:01:18
Uptime 0 days 8 hr. 19 min. 52 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
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
此時監聽日誌對應的資訊已經不在。
3.設定LOGGING_
1)啟用監聽日誌寫出
使用“set log_status on”命令啟用監聽日誌功能
LSNRCTL> set log_status on
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1521)))
LISTENER parameter "log_status" set to ON
The command completed successfully
2)檢視監聽狀態
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 30-AUG-2011 13:01:18
Uptime 0 days 8 hr. 21 min. 12 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
3)在listener.ora檔案中增加“LOGGING_LISTENER=OFF”
secdb@secdb /home/oracle$ cd $ORACLE_HOME/network/admin
secdb@secdb /oracle/ora10gR2/product/10.2.0/db_2/network/admin$ vi listener.ora
listener=
(description=
(address=(protocol=tcp)(host=secdb)(port=1521)))
LOGGING_LISTENER=OFF
~
~
4)停啟監聽器使引數調整生效
secdb@secdb /oracle/ora10gR2/product/10.2.0/db_2/network/admin$ lsnrctl
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 30-AUG-2011 21:31:50
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> stop
Connecting to (DESCRIPTION=(address=(protocol=tcp)(host=secdb)(port=1521)))
The command completed successfully
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
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 30-AUG-2011 21:32:01
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
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=secdb.localdomain)(PORT=1521)))
The listener supports no services
The command completed successfully
LSNRCTL>
調整完畢,此時監聽器狀態中已經不存在有關監聽器日誌資訊。監聽器日誌寫出已被禁用。
4.小結
本文給出了兩種禁止生成監聽日誌的方法,一種方法是在不需要重啟監聽器的情況下透過設定log_status引數為off來實現,另外一種方法是在listener.ora檔案中增加LOGGING_
另外,監聽日誌中記錄了大量有關監聽器的使用資訊,是否禁止產生監聽日誌請謹慎抉擇。
Good luck.
secooler
11.08.30
-- The End --
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29254281/viewspace-1814072/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 管理監聽器日誌listener.log
- 11G Oracle 關閉監聽XML日誌產生的方法OracleXML
- listener_scan1.log、listener.log監聽日誌清理
- rac scan listener log 清理監聽日誌 oracleOracle
- 如何線上操作監聽日誌listener.log
- Oracle 監聽器日誌解析Oracle
- 監聽器日誌檔案(listener.log)到底記錄了些啥
- Web中的監聽器【Listener】Web
- Oracle 監聽器日誌解析(續)Oracle
- Oracle 監聽器日誌配置與管理Oracle
- 關閉監聽的日誌。
- 清理資料庫監聽日誌最好方法資料庫
- ORACLE監聽器 The listener supports no services 問題解決方法Oracle
- 如何更改監聽器日誌檔名稱
- oracle清理監聽日誌Oracle
- 7、listener監聽
- 【LISTENER】使用Oracle隱含引數禁止“_XPT”服務註冊到監聽器Oracle
- oracle 監聽日誌停止寫入的解決方法Oracle
- 使用 TypeScript 自定義裝飾器給類的方法增添監聽器 ListenerTypeScript
- Oracle listener log 日誌分析方法Oracle
- 監聽日誌檔案的管理
- 設定 Oracle 監聽器密碼(LISTENER)Oracle密碼
- ORACLE啟動監聽器 The listener supports no services 問題解決方法Oracle
- listener監聽監控指令碼指令碼
- Filter(過濾器)與Listener(監聽器)詳解Filter過濾器
- oracle監聽器日誌過大-處理辦法Oracle
- Oracle之外部表監聽日誌Oracle
- ORACLE停止監聽日誌檔案Oracle
- 減少oracle日誌的產生Oracle
- 刪除oracle 11g的警告日誌和監聽日誌Oracle
- Oracle監聽日誌2g-監聽啟動報錯Oracle
- 定時清理監聽日誌的指令碼 。指令碼
- Web中的監聽器【Listener】與過濾器【Filter】 例項Web過濾器Filter
- 使用外部表訪問監聽日誌
- oracle 日誌產生大小的計算Oracle
- 2.5.2. 監聽程式(listener)配置——2.5.2.3. 手工編輯監聽器配置檔案
- 監聽MySQL的binlog日誌工具分析:CanalMySql
- 動態註冊監聽Listener