处理Oracle 监听文件listener.log问题
程序员文章站
2022-04-01 09:18:15
如果连接时候变得较慢 查看oracle日志记录,可能是因为此文件太大,超过2g,
需要定期清理,(如果多用户,记得用root,可能没权限)
查看lis...
如果连接时候变得较慢 查看oracle日志记录,可能是因为此文件太大,超过2g,
需要定期清理,(如果多用户,记得用root,可能没权限)
查看listener.log?
find / -name listener.log
经查看,竟然高达2g得日志数据,由于一些老旧的os不支持2gb以上的文件,故当listener.log文件
超过2gb时,会出现无法处理新的连接,新的操作系统虽然不会出现这个问题,但我们依然需要对其
进行定期处理清理。
listener log日志文件处理
[oracle@localhost home]$ lsnrctl lsnrctl> set log_status off connecting to (description=(address=(protocol=ipc)(key=extproc1521))) listener parameter "log_status" set to off the command completed successfully lsnrctl> show log_status connecting to (description=(address=(protocol=ipc)(key=extproc1521))) listener parameter "log_status" set to off the command completed successfully lsnrctl> exit [oracle@localhost home]$ find -name listener.log home/oracle/app/oracle/diag/tnslsnr/localhost/listener/trace/listener.log [oracle@localhost ~]$ cd /home/oracle/app/oracle/diag/tnslsnr/localhost/listener/trace/ [oracle@localhost trace]$ mv listener.log listener.log.20191127 [oracle@localhost trace]$ ls listener.log.20191127 ora_2617_140154513196800.trc [oracle@localhost trace]$ lsnrctl lsnrctl> set log_status on connecting to (description=(address=(protocol=ipc)(key=extproc1521))) listener parameter "log_status" set to on the command completed successfully lsnrctl> show log_status connecting to (description=(address=(protocol=ipc)(key=extproc1521))) listener parameter "log_status" set to on the command completed successfully lsnrctl> reload connecting to (description=(address=(protocol=ipc)(key=extproc1521))) the command completed successfully lsnrctl> exit [oracle@localhost trace]$
[oracle@localhost home]$ lsnrctl lsnrctl> set log_status off lsnrctl> show log_status lsnrctl> exit [oracle@localhost home]$ find -name listener.log [oracle@localhost trace]$ mv listener.log listener.log.20191127 lsnrctl> set log_status on lsnrctl> reload
我们通过重命名日志文件之后,会自动生成一个新的listener.log文件。当然也可以进行清空处理,可以先copy一下备份,然后进行清空处理。
总结
以上所述是小编给大家介绍的处理oracle 监听文件listener.log问题,希望对大家有所帮助