Backup Listener log

In database production, the log of listener was grow rapidly, some times if you move the "listener.log" while the listener is up and running, listener will stop writing to log file after you move/delete the "listener.log", it won't create new log file.
The listener log status will be 'off', You need to start the "listener log" again manually. For this reason you must do this procedure.

bash> lsnrctl stat
LSNRCTL for Solaris: Version 9.2.0.6.0 - Production on 09-MAR-2008 12:43:22
 
Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Solaris: Version 9.2.0.6.0 - Production
Start Date                11-SEP-2007 03:34:17
Uptime                    180 days 9 hr. 9 min. 4 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Parameter File   /oracle/app/product/9.2.0/network/admin/listener.ora
Listener Log File         /oracle/app/product/9.2.0/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=HOSTNAME)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "DB_SID.domain.com" has 2 instance(s).
Instance "DB_SID", status UNKNOWN, has 1 handler(s) for this service...
Instance "DB_SID", status READY, has 1 handler(s) for this service...
The command completed successfully
bash> lsnrctl
LSNRCTL> SET log_status off
Connecting TO (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
LISTENER parameter "log_status" SET TO OFF
The command completed successfully
bash> mv /oracle/app/product/9.2.0/network/log/listener.log /backup/listener.log_9-March-2008
LSNRCTL> set log_status on
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
LISTENER parameter "log_status" set to ON
The command completed successfully
Printed from: http://sysinfo.bascomp.org/oracle/backup-listener-log/ .
© 2012.

1 Comment   »

  • yunardi says:

    from dba point of view, this is correct procedure (using oracle command)
    But simply as sysadmin just throw empty file to listener.log. Backup with cp command if needed.
    Assume you are on current directory of listener.log

    cp listener.log listener.log.old
    cat /dev/null > listener.log

RSS feed for comments on this post , TrackBack URI

Leave a Reply