【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_scan1.log、listener.log監聽日誌清理
- day25-Listener監聽器
- 7、listener監聽
- Oracle listener log 日誌分析方法Oracle
- 使用 TypeScript 自定義裝飾器給類的方法增添監聽器 ListenerTypeScript
- Filter(過濾器)與Listener(監聽器)詳解Filter過濾器
- 監聽MySQL的binlog日誌工具分析:CanalMySql
- 2.5.2. 監聽程式(listener)配置——2.5.2.3. 手工編輯監聽器配置檔案
- springboot整合整合kafka-生產者監聽器ProducerListenerSpring BootKafka
- java EE開發之Servlet第四課:監聽器(Listener)JavaServlet
- 使用 TypeScript 自定義裝飾器給類的屬性增添監聽器 ListenerTypeScript
- ORACLE之手動註冊監聽listener。alter system set local_listener="XXX"Oracle
- 2024/11/20日 日誌 關於 Filter & ListenerFilter
- 2.5.2. 監聽程式(listener)配置——2.5.2.1. netca
- 2.5.2. 監聽程式(listener)配置——2.5.2.2. netmgr
- 【LISTENER】Oracle通過監聽連線緩慢分析Oracle
- 減少日誌產生量小結
- JAVA單元測試框架-13-TestNG中的Listener監聽Java框架
- oracle 資料庫lsnrctl監聽的日誌路徑和trace檔案Oracle資料庫
- 解決生產日誌重複列印的問題
- update操作會產生幾條mlog$日誌?
- javaWeb中的監聽器JavaWeb
- 黑盒監控、日誌監控
- oracle監聽檔案listener.ora for 10g/11gOracle
- C++記憶體物件大會戰 禁止產生堆物件 禁止產生棧物件C++記憶體物件
- 聊一聊如何截獲 C# 程式產生的日誌C#
- C#輕量級日誌監控器EasyLogMonitorC#
- 監聽發現區域網dropbox客戶端broadcast-dropbox-listener客戶端AST
- JMeter—監聽器(十二)JMeter
- Mysql事件監控日誌MySql事件
- 監聽器和過濾器過濾器
- spring-boot-route(十六)使用logback生產日誌檔案Springboot
- springBoot的過濾器,監聽器,攔截器Spring Boot過濾器
- 監聽檔案修改的四種方法
- Zabbix如何監控Oracle的告警日誌Oracle
- 事件和事件監聽器事件
- 如何移除事件監聽器事件
- vue的監聽鍵盤事件的快捷方法Vue事件
- python監控伺服器應用日誌,推送釘釘機器人,實時關注日誌異常Python伺服器應用日誌機器人