How to rotate listener log online
How to rotate listener log online
In oracle listener log file contains a lot of useful information, like the program which was used for the connection, the IP address where the connection is coming from, the OS user which was used on the client and we can add many more to be recorded.
Since it records more information the log file will keep growing. We may need to do some maintenance to rotate the log. As the log file is actively used by oracle it will be difficult to rotate during db is online.
One best way is we can have procedure to off the listener logging and rotate the log and enable the listener logging during offbusiness hours. This does not required any downtime on the database
lsnrctl <<-EOF
set current_listener
set log_status off
EOF
mv
lsnrctl <<-EOF
set current_listener
set log_status on
EOF