ITPub博客

首页 > 数据库 > Oracle > Oracle 监听器日志 listener.log文件过大处理

Oracle 监听器日志 listener.log文件过大处理

原创 Oracle 作者:wg0411 时间:2017-06-01 09:33:22 0 删除 编辑
今天遇到报警,alert.log报出异常
[html] view plain copy
  1. WARNING: inbound connection timed out (ORA-3136)  
  2. Thu Nov 21 11:13:49 2013  
  3. WARNING: inbound connection timed out (ORA-3136)  
  4. Thu Nov 21 11:14:54 2013  
  5. WARNING: inbound connection timed out (ORA-3136)  
  6. Thu Nov 21 11:15:01 2013  
  7. WARNING: inbound connection timed out (ORA-3136)  
  8. Thu Nov 21 11:15:49 2013  
  9. WARNING: inbound connection timed out (ORA-3136)  
  10. Thu Nov 21 11:16:18 2013  
  11. WARNING: inbound connection timed out (ORA-3136)  
  12. Thu Nov 21 11:31:00 2013  
  13. WARNING: inbound connection timed out (ORA-3136)  

分析原因:

1:数据库负载正常

2:没有发现有Dos攻击迹象

3:防火墙的策略没有问题  防火墙的问题应该是长期的问题,不会今天报出超时,而以前没有。


查看listener.log 与sqlnet.log 发现主要是某app服务器上PHP应用链接异常,此问题先报给SA进行分析。

在查看listener.log时发现文件最新内容是上月的记录,查看了lsnrctl的状态也均运行正常。

[plain] view plain copy
  1. LSNRCTL> show    
  2. The following operations are available after show  
  3. An asterisk (*) denotes a modifier or extended command:  
  4.   
  5. rawmode                     displaymode                   
  6. rules                       trc_file                      
  7. trc_directory               trc_level                     
  8. log_file                    log_directory                 
  9. log_status                  current_listener              
  10. inbound_connect_timeout     startup_waittime              
  11. snmp_visible                save_config_on_stop           
  12. dynamic_registration          
  13.   
  14. LSNRCTL> show log_file  
  15. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxxxxxx)(PORT=1521)))  
  16. LISTENER parameter "log_file" set to listener.log  
  17. The command completed successfully  
  18. LSNRCTL> show log_status  
  19. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxxxxxxx)(PORT=1521)))  
  20. LISTENER parameter "log_status" set to ON  
  21. The command completed successfully  
  22. LSNRCTL> show log_directory  
  23. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxxxxxxxx)(PORT=1521)))  
  24. LISTENER parameter "log_directory" set to /u01/app/product/oracle/10.2.0/network/log/  
  25. The command completed successfully  
  26. LSNRCTL>   

监听目前处于正常状态,日志功能也打开,后来一想,原来是日志文件大小已满。

处理:

1:首先 停止日志

[html] view plain copy
  1. LSNRCTL> set  log_status off     
2:到目录/u01/app/product/oracle/10.2.0/network/log/
mv   listener.log  listener.log.bak

3:开启日志 

[html] view plain copy
  1. LSNRCTL> set  log_status on  
4:重新加载监听器

[html]
 view plain copy
  1. LSNRCTL> reload                            
  2. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxxxxxxxx)(PORT=1521)))  
  3. The command completed successfully  
  4. LSNRCTL>   
5:目录下重新生成新的日志,压缩保存

[html]
 view plain copy
  1. tar zcvf listener-20131121.log.tar.gz  listener.log.bak  
删除原有的日志:

[html]
 view plain copy
  1. rm   listener.log.bak  

今后准备编写脚本,定期备份监听日志,避免出现满的情况。


导致listener.log日志过大超过4G的原因为windows系统下oracle的bug问题。
测试库监听日志路径如下:
C:\app\BI\diag\tnslsnr\DESKTOP-S5CNE16\listener\trace
C:\app\BI\diag\tnslsnr\DESKTOP-S5CNE16\listener\alert
C:\app\Administrator\diag\tnslsnr\DESKTOP-S5CNE16\listener2\trace

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29578568/viewspace-2140153/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-03-31

  • 博文量
    235
  • 访问量
    536103