Being DBA we all are aware that Oracle Database makes a connection with a client with the help of listener. Oracle provides the facility to have look over the status of Oracle listen. Being a part of IT we must be aware that 24*7 We require database live but due to some unfortunate conditions database lose its connection. It happens lots of time to clear the old entries of the old listener.
In this blog, we are going to have look how to purge listener log data.
How to Purge Listener Log Data?
[oracle@server1 trace]$ cp listener.log listener_backup.log [oracle@server1 trace]$ cat /dev/null>listener.log [oracle@server1 trace]$ gzip listener_backup.log
[oracle@server1 ~]$ lsnrctl LSNRCTL for Linux: Version 22.214.171.124.0 - Production on 02-JAN-2012 13:17:22 Copyright (c) 1991, 2011, Oracle. All rights reserved. Welcome to LSNRCTL, type "help" for information. LSNRCTL> show current_listener Current Listener is LISTENER
If you want to change the current listener then execute the following command:
LSNRCTL> set current_listener <listenername> LSNRCTL> set log_status off Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=server1.test.com)(PORT=1521))) LISTENER parameter "log_status" set to OFF The command completed successfully
From another window rename the log file, then return to the previous window.
[oracle@server1 trace]$ mv listener.log listener_backup.log
LSNRCTL> set log_status on Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=server1.test.com)(PORT=1521))) LISTENER parameter "log_status" set to ON The command completed successfully
This will create a new and empty listener.log file which will continue logging.
When you innovate, you’ve got to be prepared for everyone telling you you’re nuts. Larry Ellison
Read more at https://www.brainyquote.com/authors/larry_ellison