Search the Site

Sponsors

bottom corner

Cleaning up the listener log

Inevitably, a DBA will sometimes forget to check the size of the listener log file, and the file will grow to a large size. This is how we can clean up the log file.

This page is filed under keyword(s): oracle.

Since we noticed the listener log has grown out of control, we should already know the location of it. Just in case you need it, by default that log file is located at "NETWORK/log/listener.log" in your Oracle home.

The listener log cannot be modified while the listener is active, and more than likely, we need to minimize listener down time so we interrupt users the least. To do so, we are going to create a batch file so that the three commands we are going to run will run successively in a short amount of time. Alternatively, you can also perform them during business off-hours, if that is available to you. Either running in a batch file or running them manually, the commands are the same.

lsnrctl set log_status off
rename listener.log listener.old
lsnrctl set log_status on

The first commands is used to disable the listener, which will release the file lock on the listener.log file so we can work with it. The second command renames the file. Finally, the third command restarts the listener to resume normal operations. Immediately after the third command runs, a new listener.log file will be created with 0 size.

What to do with the old listener log "listener.old" is up to each of us. Personally, I tend to zip up the file and store it at a safe place, just in case I ever need to review it.

Did you find this page useful? Please consider browsing other articles or subscribing to the RSS feed to keep up with latest.

This page is filed under keyword(s): oracle.
Author: C. Peter Chen
Last updated: 25 Mar 2008

bottom corner