Back to Scripting | Daily Renaming of ORACLE Alert Logs
ORACLE alert logs will grow to the maximum size specified in the init.ora file before the information they contain will be overwritten. With this in mind, it can be very useful to have an alert log specific to each day. The scripts provided will rename the ORACLE alert log and append the date to the file name nightly.
Rename_ALERT.cmdREM Add an event to the NT event log to indicate startlogevent -s I "Oracle ARCHIVE ALERTS job started"REM Run the vbscript passing in the ORACLE alert log filename and the new destination filename. The VBscript willREM automatically append the current date (YYYYMMDD) to the end of the filename in front of the file extension.cscript d:\SharedScripts\RenameAppendDate.vbs d:\Orant\bdump\rtppALRT.log d:\Orant\bdump\archived_alerts\rtppALRT.logREM Add an event to the NT event log to indicate completionlogevent -s I "Oracle ARCHIVE ALERTS job finished"exitRenameAppendDate.vbs
Please see the generic script entitled "Rename/move file with date appended between filename and file extension".
Adding this job to the schedulerAT 11:59PM /EVERY:M,T,W,Th,F,S,Su "D:\Scheduled\Rename_ALERT.cmd"