Thursday, April 9, 2015

ORACLE HOW TO MANIPULATE LISTENER.LOG WITHOUT STOP THE LISTENER

Sometimes, you need manipulate the listener.log because it's too big or your disk device is full and you can't stop the service for your business then this is the solution, stop the generation of  entries into the logfile but the listener continue executing.

this is a script into crontab running each 2 weeks. In this script I stop the inserts into the listener.log, compress the file and start the inserts into a new  listener.log

lsnrctl << EOF
set current_listener LISTENER
set log_status off
exit
EOF
go to place of your listener.log and then, delete, move or compress....
gzip listener.log
lsnrctl << EOF
set current_listener LISTENER
set log_status on
exit
EOF

after this operation you can see in the directory

listener.log.gz -----> old file compressed
listener.log -----> new file generated

No comments:

Post a Comment