This something I do on NT and W2K servers. Modify it as needed.
rem filename: listener_log_rename.bat
rem date: 21 Sep 01
rem
rem This script archives a specified listener log, keeping
rem the last 30 copies.
rem Set the following variables:
rem ----------------------------
set DB=dbxp
set SCRIPT_DRIVE=d
set SCRIPT_DIR=%SCRIPT_DRIVE%:\oradba\admin\%DB%\scripts
set LISTENER_LOG_DRIVE=d
rem
rem Examples for LISTENER_LOG_DIR:
rem 8.1.7 -> %LISTENER_LOG_DRIVE%:\orant\ora_817\network\log
rem 8.0.5 -> %LISTENER_LOG_DRIVE%:\orant\net80\log
rem 7.3.4 -> %LISTENER_LOG_DRIVE%:\orant\network\log
set LISTENER_LOG_DIR=%LISTENER_LOG_DRIVE%:\orant\ora_817\network\log
rem
rem LISTENER_CONTROL is the name of the listener control executable.
rem It is usually "lsnrctl". In 8.0 it is "lsnrctl80".
set LISTENER_CONTROL=lsnrctl
rem
rem LISTENER_NAME is the actual name of the listener within lsnrctl.
rem For non-OFS listeners, it is usually just "listener".
rem For OFS listeners, it is "fsl" plus the name of the OFS group.
rem For example, DARP's listener name is "fslausviper".
set LISTENER_NAME=listener
rem
rem LISTENER_LOG_NAME is the name of the listener log file, excluding
rem the ".log". In most cases, it is the same as the listener name.
rem However, in OFS version 2, there is an 8-character limit on the
rem base name of the listener log file. For example, FMS1's OFS
rem group is "pn2fms1prodofs". Its listener log file, however, is
rem just "fslpn2fm" plus ".log". Again, do not include ".log" here.
set LISTENER_LOG_NAME=listener
rem Not necessary to modify the following variables
rem -----------------------------------------------
set LISTENER_LOG=%LISTENER_LOG_DIR%\%LISTENER_LOG_NAME%
set LISTENER_TEMP=lsnrtemp
rem Deletes listener log #30 (oldest), if it exists
rem -----------------------------------------------
if exist %LISTENER_LOG%_30.log del %LISTENER_LOG%_30.log
rem Renames each of the listener logs, if they exist
rem ------------------------------------------------
if exist %LISTENER_LOG%_29.log rename %LISTENER_LOG%_29.log
%LISTENER_LOG_NAME%_30.log
if exist %LISTENER_LOG%_28.log rename %LISTENER_LOG%_28.log
%LISTENER_LOG_NAME%_29.log
if exist %LISTENER_LOG%_27.log rename %LISTENER_LOG%_27.log
%LISTENER_LOG_NAME%_28.log
if exist %LISTENER_LOG%_26.log rename %LISTENER_LOG%_26.log
%LISTENER_LOG_NAME%_27.log
if exist %LISTENER_LOG%_25.log rename %LISTENER_LOG%_25.log
%LISTENER_LOG_NAME%_26.log
if exist %LISTENER_LOG%_24.log rename %LISTENER_LOG%_24.log
%LISTENER_LOG_NAME%_25.log
if exist %LISTENER_LOG%_23.log rename %LISTENER_LOG%_23.log
%LISTENER_LOG_NAME%_24.log
if exist %LISTENER_LOG%_22.log rename %LISTENER_LOG%_22.log
%LISTENER_LOG_NAME%_23.log
if exist %LISTENER_LOG%_21.log rename %LISTENER_LOG%_21.log
%LISTENER_LOG_NAME%_22.log
if exist %LISTENER_LOG%_20.log rename %LISTENER_LOG%_20.log
%LISTENER_LOG_NAME%_21.log
if exist %LISTENER_LOG%_19.log rename %LISTENER_LOG%_19.log
%LISTENER_LOG_NAME%_20.log
if exist %LISTENER_LOG%_18.log rename %LISTENER_LOG%_18.log
%LISTENER_LOG_NAME%_19.log
if exist %LISTENER_LOG%_17.log rename %LISTENER_LOG%_17.log
%LISTENER_LOG_NAME%_18.log
if exist %LISTENER_LOG%_16.log rename %LISTENER_LOG%_16.log
%LISTENER_LOG_NAME%_17.log
if exist %LISTENER_LOG%_15.log rename %LISTENER_LOG%_15.log
%LISTENER_LOG_NAME%_16.log
if exist %LISTENER_LOG%_14.log rename %LISTENER_LOG%_14.log
%LISTENER_LOG_NAME%_15.log
if exist %LISTENER_LOG%_13.log rename %LISTENER_LOG%_13.log
%LISTENER_LOG_NAME%_14.log
if exist %LISTENER_LOG%_12.log rename %LISTENER_LOG%_12.log
%LISTENER_LOG_NAME%_13.log
if exist %LISTENER_LOG%_11.log rename %LISTENER_LOG%_11.log
%LISTENER_LOG_NAME%_12.log
if exist %LISTENER_LOG%_10.log rename %LISTENER_LOG%_10.log
%LISTENER_LOG_NAME%_11.log
if exist %LISTENER_LOG%_09.log rename %LISTENER_LOG%_09.log
%LISTENER_LOG_NAME%_10.log
if exist %LISTENER_LOG%_08.log rename %LISTENER_LOG%_08.log
%LISTENER_LOG_NAME%_09.log
if exist %LISTENER_LOG%_07.log rename %LISTENER_LOG%_07.log
%LISTENER_LOG_NAME%_08.log
if exist %LISTENER_LOG%_06.log rename %LISTENER_LOG%_06.log
%LISTENER_LOG_NAME%_07.log
if exist %LISTENER_LOG%_05.log rename %LISTENER_LOG%_05.log
%LISTENER_LOG_NAME%_06.log
if exist %LISTENER_LOG%_04.log rename %LISTENER_LOG%_04.log
%LISTENER_LOG_NAME%_05.log
if exist %LISTENER_LOG%_03.log rename %LISTENER_LOG%_03.log
%LISTENER_LOG_NAME%_04.log
if exist %LISTENER_LOG%_02.log rename %LISTENER_LOG%_02.log
%LISTENER_LOG_NAME%_03.log
if exist %LISTENER_LOG%_01.log rename %LISTENER_LOG%_01.log
%LISTENER_LOG_NAME%_02.log
rem Builds first listener command file
rem ----------------------------------
echo set current_listener %LISTENER_NAME% >
%SCRIPT_DIR%\listener_log_rename_1.lsnr
echo set log_file %LISTENER_TEMP% >> %SCRIPT_DIR%\listener_log_rename_1.lsnr
rem Executes first listener command file
rem These listener commands reset the listener log to a temporary file
rem ------------------------------------------------------------------
type %SCRIPT_DIR%\listener_log_rename_1.lsnr | %LISTENER_CONTROL%
rem Renames the most recent listener log
rem ------------------------------------
if exist %LISTENER_LOG%.log rename %LISTENER_LOG%.log
%LISTENER_LOG_NAME%_01.log
rem Builds second listener command file
rem -----------------------------------
echo set current_listener %LISTENER_NAME% >
%SCRIPT_DIR%\listener_log_rename_2.lsnr
echo set log_file %LISTENER_LOG_NAME% >>
%SCRIPT_DIR%\listener_log_rename_2.lsnr
rem Executes second listener command file
rem These listener commands reset the listener log back to its original name
rem ------------------------------------------------------------------------
type %SCRIPT_DIR%\listener_log_rename_2.lsnr | %LISTENER_CONTROL%
rem Deletes temporary files
rem -----------------------
del %LISTENER_LOG_DIR%\%LISTENER_TEMP%.log
del %SCRIPT_DIR%\listener_log_rename_1.lsnr
del %SCRIPT_DIR%\listener_log_rename_2.lsnr
-----Original Message-----
Sent: Wednesday, September 26, 2001 4:15 AM
To: LazyDBA.com Discussion
Just do this
> listener.log
Sinardy
-----Original Message-----
Sent: Wednesday, 26 September 2001 3:27 PM
To: LazyDBA.com Discussion
Hi salman
Environment is
Oracle 8.1.5 in win NT
rgds,
shibu
- Original Message -----
To: "shibu" <basher.shibu_at_acusis.com>
Sent: Wednesday, September 26, 2001 12:49 PM
>
> which o/s you are using??
>
>
>
>
> "shibu" <basher.shibu_at_acusis.com> on 09/26/2001 12:11:58 PM
>
> To: "LazyDBA.com Discussion" <oracledba_at_lazydba.com>
> cc:
> Subject: flushing listener.log
>
>
>
> Hi all
> My listener.log has grown to size of 1.5 gb? Now i am not able to
> open it and delete it . How can? i reduce the size without taking
> database down? How often do u guys flush it?
>
> rgds,
> shibu
>
>
>
Oracle documentation is here:
http://tahiti.oracle.com/pls/tahiti/tahiti.homepage
To unsubscribe: send a blank email to oracledba-unsubscribe_at_LAZYDBA.com
To subscribe: send a blank email to oracledba-subscribe_at_LAZYDBA.com
Visit the list archive:
http://www.LAZYDBA.com/odbareadmail.pl
Tell yer mates about
http://www.farAwayJobs.com
By using this list you agree to these
terms:
http://www.lazydba.com/legal.html
Oracle documentation is here:
http://tahiti.oracle.com/pls/tahiti/tahiti.homepage
To unsubscribe: send a blank email to oracledba-unsubscribe_at_LAZYDBA.com
To subscribe: send a blank email to oracledba-subscribe_at_LAZYDBA.com
Visit the list archive:
http://www.LAZYDBA.com/odbareadmail.pl
Tell yer mates about
http://www.farAwayJobs.com
By using this list you agree to these
terms:
http://www.lazydba.com/legal.html
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author:
INET: Gautam_Reddy_at_Dell.com
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 Wed Sep 26 2001 - 14:08:09 CDT