Oracle数据库运维:要对监听日志文件(listener.log)进行定期清理,如果不定期清理,会遇到下面一些麻烦

时间:2022-05-16 22:07:25

原文链接:

http://www.lookdaima.com/WebForms/WebPages/Blanks/Pm/Docs/DocItemDetail.aspx?EmPreviewTypeV=2&id=279e64d5-7b60-43fa-b662-33731e895c84

要对监听日志文件(listener.log)进行定期清理,如果不定期清理,会遇到下面一些麻烦:

     1:监听日志文件(listener.log)变得越来越大,占用额外的存储空间。(当然现在存储白菜价,不差那几G的空间。但是我们还是要本着工匠情怀,精益求精)
     2:监听日志文件(listener.log)变得太大会带来一些问题:LISTENER.LOG日志大小不能超过2GB,超过会导致LISTENER监听器无法处理新的连接。
     3:监听日志文件(listener.log)变得太大,给写入、查看带来的一些性能问题、麻烦。
 
另:
监听日志listener.log日志放在了$ORACLE_BASE/diag/tnslsnr/机器名/listener/trace目录下
 
日志内容如下参考:


Thu May 24 05:36:17 2018
24-5月 -2018 05:36:17 * service_update * orcl * 0
Thu May 24 05:36:49 2018
24-5月 -2018 05:36:49 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=E:\app\Administrator\product\11.2.0\dbhome_1\perl\bin\perl.exe)(HOST=WIN-8HJG4A1OU19)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=fe80::e83b:4238:1673:433f%12)(PORT=58682)) * establish * orcl * 0
Thu May 24 05:37:02 2018
24-5月 -2018 05:37:02 * service_update * orcl * 0
Thu May 24 05:37:17 2018
24-5月 -2018 05:37:17 * service_update * orcl * 0
Thu May 24 05:37:47 2018
24-5月 -2018 05:37:47 * service_update * orcl * 0
Thu May 24 05:38:17 2018
24-5月 -2018 05:38:17 * service_update * orcl * 0
24-5月 -2018 05:38:27 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=E:\app\Administrator\product\11.2.0\dbhome_1\perl\bin\perl.exe)(HOST=WIN-8HJG4A1OU19)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=fe80::e83b:4238:1673:433f%12)(PORT=58706)) * establish * orcl * 0
Thu May 24 05:38:28 2018
24-5月 -2018 05:38:28 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=E:\app\Administrator\product\11.2.0\dbhome_1\perl\bin\perl.exe)(HOST=WIN-8HJG4A1OU19)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=fe80::e83b:4238:1673:433f%12)(PORT=58708)) * establish * orcl * 0
Thu May 24 05:38:56 2018
24-5月 -2018 05:38:56 * service_update * orcl * 0
Thu May 24 05:39:13 2018
24-5月 -2018 05:39:13 * ping * 0
24-5月 -2018 05:39:16 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\Windows\SysWOW64\inetsrv\w3wp.exe)(HOST=WIN-V6IU3UNF8UB)(USER=EasyWorkWebSite))) * (ADDRESS=(PROTOCOL=tcp)(HOST=10.2.135.122)(PORT=60532)) * establish * orcl * 0
24-5月 -2018 05:39:17 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=WIN-8HJG4A1OU19)(PORT=1521)))(VERSION=186646784)) * status * 0
24-5月 -2018 05:39:17 * service_update * orcl * 0
Thu May 24 05:39:26 2018
24-5月 -2018 05:39:26 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=E:\app\Administrator\product\11.2.0\dbhome_1\perl\bin\perl.exe)(HOST=WIN-8HJG4A1OU19)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=fe80::e83b:4238:1673:433f%12)(PORT=58722)) * establish * orcl * 0
24-5月 -2018 05:39:27 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=E:\app\Administrator\product\11.2.0\dbhome_1\perl\bin\perl.exe)(HOST=WIN-8HJG4A1OU19)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=fe80::e83b:4238:1673:433f%12)(PORT=58723)) * establish * orcl * 0
Thu May 24 05:39:47 2018
24-5月 -2018 05:39:47 * service_update * orcl * 0
24-5月 -2018 05:39:53 * service_update * orcl * 0
Thu May 24 05:40:17 2018
24-5月 -2018 05:40:17 * service_update * orcl * 0