archiving listener log
Date: Tue, 17 May 2011 10:50:43 -0400
Message-ID: <OF2E920D27.456F7778-ON85257893.00511269-85257893.00518C95_at_lazard.com>
I use log_staus to achieve this as below:
YMD=$(date +%Y%m%d_%T)
mv $ORACLE_HOME/network/log/${listener_name}.log /<archives
directory>/${listener_name}.log.${YMD}
# Turn listener logging off and on so that listener logging can start
lsnrctl << eof1
set current_listener ${listener_name} set log_status off set log_status on exit
eof1
It has been working for years. Does anyone see any issue with this? (I just want to find out if I am doing this right or not)
Thank you
Mayen
From: "Rich Jesse" <rjoralist2_at_society.servebeer.com>
To: oracle-l_at_freelists.org
Date: 05/17/2011 10:42 AM
Subject: Re: [SOLVED] missing alert.log mystery (it's not what you
think)
Sent by: oracle-l-bounce_at_freelists.org
Niall writes:
> In the case of the listener then lsnrctl can be used to rename the log file
In unixish, something like this:
# Temporarily change the listener log location
lsnrctl <<EOD1
set log_file listener_OLD
EOD1
# Archive the listener log by renaming
mv $ORACLE_HOME/network/log/listener.log
$ORACLE_HOME/network/log/listener.log_`date +\%y\%m\%d\%H\%M\%S`
# Reset the listener log location
lsnrctl <<EOD2
set log_file listener
EOD2
# Keep two weeks worth.
find $ORACLE_HOME/network/log/*.log_???????????? -mtime +14|xargs -i -t rm
{}
A cleanup of the ever-growing "listener_OLD" file is in order as well. Perhaps a similar rename/purge...
YMMV. Standard "not my fault" disclaimer applies. :)
Rich
-- http://www.freelists.org/webpage/oracle-l -- http://www.freelists.org/webpage/oracle-lReceived on Tue May 17 2011 - 09:50:43 CDT