Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Maintenance of listener.log files

Re: Maintenance of listener.log files

From: Hemant K Chitale <hkchital_at_singnet.com.sg>
Date: Sat, 24 Aug 2002 08:03:21 -0800
Message-ID: <F001.004BF19E.20020824080321@fatcity.com>

You can do it online. I have a CRON job which periodically truncates the file to the last X (e.g. 20000) lines. In this code, I've added your requirement
to archive and preserve the log.

e.g

#!/usr/bin/sh
set `date`
ORACLE_HOME=/u01/app/oracle/product/8.1.7;export ORACLE_HOME cd $ORACLE_HOME/network/log
find . -name 'listener.log.preserve*' -mtime +15 -exec rm {} \; cp listener.log listener.log.preserve.$1$2 touch to_overwrite
#optional : keep the last 20000 lines of the logfile #tail -20000 listener.log > to_overwrite cat to_overwrite > listener.log

Test the script before you use it.
Essentially, you can overwrite the listener.log online -- but you should not try to "rm" or "mv" it .

Hemant

At 08:53 AM 23-08-02 -0800, you wrote:
>Hello all,
>
>I have an 8.1.7.4 database on 11.0 HP-UX server with a listener.log file and
>it records information as long as the listener is up. The problem is that
>the listener is always up and the file is getting larger and larger. I am
>looking for a way to periodically copy the data from the listener.log to
>another file (that would be around for two weeks and then purged) without
>having to bring the listener down. It seems like one of those tricks of
>replacing a tire on a car while it is still being driven.
>
>TIA,
>
>Bryan Rodrigues
>DBA
>Elcom, Inc.

Hemant K Chitale
Now using Eudora Email. Try it !

My home page is : http://hkchital.tripod.com

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Hemant K Chitale
  INET: hkchital_at_singnet.com.sg

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Sat Aug 24 2002 - 11:03:21 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US