RE: Renaming / deleting listener.log and alert log

  • From: "Mercadante, Thomas F (LABOR)" <Thomas.Mercadante@xxxxxxxxxxxxxxxxx>
  • To: <Paul.Vincent@xxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 10 Jun 2005 07:31:38 -0400

Paul,

It is absolutely ok to rename the alert.log while the database is up and
running.  I do it all the time.  This file is not open all the time -
Oracle opens and closes it as it needs to write to it.

The listener log is different - it is open all the time.
First of all, think about why you continue to write this log file.  It
truly is worthless - unless you are trying to debug connection activity.
You can turn logging off by putting the following in the listner.ora
file:

LOGGING_LISTENER =3D OFF

You can also turn it off interactively by using the set log_status
command like this:

set log_status off

To rename the listener log interactively, you use the set log_file
command.  You need to rename the current listener log to something
temporary, rename the default name, and then set the listener log back
to the default.  Below is the guts of an NT script I run every day.

@set listenerlog=3Dlistener

@rem
@rem First set the log file name via lsnrctl so we can rename it in dos
@rem
@echo set log_file %listenerlog%_temp.log       >>
h:\dba\temp\lsncmd.lsn
@echo exit                                              >>
h:\dba\temp\lsncmd.lsn

Rem  Run the commands into lsnrctl

@%oracle_home%\bin\lsnrctl <h:\dba\temp\lsncmd.lsn      >> %JobLog%
@del h:\dba\temp\lsncmd.lsn

@wait 2

@rem
@rem rename the old listener.log file  %today% is a date string.
@rem
@rename %oracle_home%\network\log\%listenerlog%.log
%listenerlog%_%today%.log >> %JobLog%

@rem
@rem now set the logfile back to listener.log via lsnrctl
@rem
@echo set log_file %listenerlog%.log            > h:\dba\temp\lsncmd.lsn
@echo exit                                                      >>
h:\dba\temp\lsncmd.lsn

@%oracle_home%\bin\lsnrctl <h:\dba\temp\lsncmd.lsn      >> %JobLog%
@del h:\dba\temp\lsncmd.lsn

@rem
@rem append the latest listener.log to the original one
@rem
@if exist %oracle_home%\network\log\%listenerlog%_temp.log type
%oracle_home%\network\log\%listenerlog%_temp.log
>>%oracle_home%\network\log\%listenerlog%_%today%.log
@if exist %oracle_home%\network\log\%listenerlog%_temp.log del
%oracle_home%\network\log\%listenerlog%_temp.log                >>
%JobLog%


Any questions, please let me now.

Tom


-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Paul Vincent
Sent: Friday, June 10, 2005 3:35 AM
To: oracle-l@xxxxxxxxxxxxx
Subject: Renaming / deleting listener.log and alert log

OK folks - please help me out with this old chestnut:

When the listener log, and the database alert log, start to reach
unwieldy sizes, it's time to either delete the log, or - better - rename
it, so that Oracle will start a fresh one. But the question of whether
this can be done "on the fly", whilst the listener or database
(respectively) are still running, or whether you have to stop the
listener or shutdown the database instance before doing so, seems to
depend on which version of Oracle and which operating system are
running.

So, by way of clarification, can anyone give a definitive answer to
these questions:

Is it safe to delete or rename the listener log file whilst the listener
is still running, for Oracle 8i under Windows 2000 Server? And how about
deleting/renaming the database alert log file without shutting down the
instance, under the same configuration (8i, Windows 2k)?

Same question for Oracle 9i under Win2k ?

Same question for Oracle 8i under Solaris?

Same question for Oracle 9i under Solaris?

If there's a clear consensus on these answers, this would be a handy FAQ
answer!

Regards,

Paul


Paul Vincent
DBA
UCE Birmingham
paul.vincent@xxxxxxxxx
--
//www.freelists.org/webpage/oracle-l
--
//www.freelists.org/webpage/oracle-l

Other related posts: