How to Purge Listener Log Data

Oracle

Solution 1:

[[email protected] trace]$ cp listener.log listener_backup.log

[[email protected] trace]$ cat /dev/null>listener.log

[[email protected] trace]$ gzip listener_backup.log

Solution 2:

[[email protected] ~]$ lsnrctl

LSNRCTL for Linux: Version 11.2.0.3.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

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 previous window.

[[email protected] 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.