Purge Listener log in Oracle

Sometimes , when you have limited space on mount point , and suddenly it starts filling up .

While checking you found that , most space is taken by tnslsnr under grid/diag.

You can purge the existing listener log and create a new empty log using the below steps .

LSNRCTL> show current_listener
Current Listener is LISTENER
LSNRCTL>
LSNRCTL>
LSNRCTL> set log_status off
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
LISTENER parameter “log_status” set to OFF
The command completed successfully

If you have different listener like listener_scan1,listner_scan2 . you can set them as well using

LSNRCTL> set current_listener listener_scan1
Current Listener is listener_scan1

After setting the proper listner , please shut down the log status .

LSNRCTL> set log_status off
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
listener_scan1 parameter “log_status” set to OFF
The command completed successfully

Using another window/session , move the existing listner log to some another name .

mv listener_scan1.log listener_scan1.log_bkp

Again go to the main window and enable the log again

LSNRCTL> set log_status on
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
listener_scan1 parameter “log_status” set to ON
The command completed successfully

LSNRCTL> set log_status on
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
listener_scan1 parameter “log_status” set to ON
The command completed successfully

Now , check if any new log file created or not

total 478216
-rw-r—– 1 grid oinstall 489580508 Jul 1 08:57 listener_scan1.log_bkp
-rw-r—– 1 grid oinstall 2937 Jul 1 08:58 listener_scan1.log

See , we have a empty file named listener_scan1.log .

delete the old file , which was taking lots of space .

trace]# rm -rf listener_scan1.log_bkp


 604 total views,  2 views today

Leave a Reply

Your email address will not be published. Required fields are marked *