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
此时监听日志对应的信息已经不在。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/21302630/viewspace-1571533/
,如需转载,请注明出处,否则将追究法律责任。