RE: archiving listener log

From: <Joel.Patterson_at_crowley.com>
Date: Wed, 18 May 2011 10:34:36 -0400
Message-ID: <C95D75DD2E01DD4D81124D104D317ACA16210AF60B_at_JAXMSG01.crowley.com>



It seems like the simplest of what was shows so far. Possible loss of a write to an 'inode'? between move and log_status switch. Could be more detailed issues involved with that, don't know.

The last algorithm in email thread I read here did not loose writes, but collected them in an 'old log file' during the switch... so assuming a switch once/week, you would see some weekly writes being collected there, until the day someone deleted it or purged it manually.

That's the tricky part about the listener log rotation. You don't wish any monitoring software to react, or users to have to retry a connection attempt, nor 'ideally' loose any data. The data the is kept is kept in chronological order as per logfile_name<date> would indicate.

The process I started was complicated due to auditing purposes and passwords (for what its worth... probably not in most cases). But does work and accomplishes all the goals of not loosing data, and all data is in the files as indicated by date in order, and the listener catches all incoming requests.

But when possible, I am an advocate of the simpler the better, and if you can miss one or two lines in the log file and live with that, then you have a good solution.

Joel Patterson
Database Administrator
904 727-2546



From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Mayen.Shah_at_lazard.com Sent: Tuesday, May 17, 2011 10:51 AM
To: rjoralist2_at_society.servebeer.com
Cc: oracle-l_at_freelists.org; oracle-l-bounce_at_freelists.org Subject: archiving listener log

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-l
Received on Wed May 18 2011 - 09:34:36 CDT

Original text of this message