Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Delete old Archive log Unix script Thanks!
Thank you for all your responses.
Michael Ma.
-----Original Message-----
From: Kristen Cameron [mailto:cameronkgd_at_inac.gc.ca]
Sent: Thursday, June 01, 2000 9:26 AM
To: Multiple recipients of list ORACLE-L
Subject: Re: Delete old Archive log Unix script
Here's a script I use to delete all kinds of old logs and other files.
#!/bin/sh
#---------------------------------------------------------------------------
# /oracle/tools/common/hskp
#
# This shell script
# 4. Purges backup logs, messages & error files older than 7 days;
# 5. Purges backup control file logs older than 7 days;
# 6. Purges backup alert file logs in $OBACKUP/backup_old older than 7
days;
# 7. Purges backup log files older than 7 days;
# 8. Purges backup alert file logs older than 7 days in backup_old.
# 9. Purges alert files in $OALERT older than 7 days.
#
# Usage: hskp <SID>
#
#
# Modifications
#
# 00MAY09 Edited for common usage by all instances
# Kristen Cameron
# 99AUG24 Fixed code for instances
# 99MAY03 Added code for instances
#
# 98NOV16 Modified from DBP1's hskp script
#
# 98OCT27 Modified from offline_backup.sh
# INAC, IMAG, (JL)
#
# 96SEP11 - Initial coding.
# GDS & Associates Systems Ltd. (GN)
#
#---------------------------------------------------------------------------
echo " " echo "---------------------------------------------------" echo "/oracle/tools/common/hskp started" `date` echo "---------------------------------------------------"
if [ $# -lt 1 ]
then
echo
echo Usage: $0 instance_id
echo
exit 1
fi
ORACLE_SID=$1
export ORACLE_SID
ORAENV_ASK=NO
export ORAENV_ASK
. oraenv
echo "Purging backup logs files on" `date` find /oracle/tools/$ORACLE_SID/log/backup* -mtime +7 -exec rm {} \; echo "Purging control file log files on" `date` find /oracle/tools/$ORACLE_SID/log/control*.log -mtime +7 -exec rm {}\;
echo "Purging datafile log files on" `date` find /oracle/tools/$ORACLE_SID/log/datafile_*.log -mtime +7 -exec rm{} \;
echo "Purging alert log files on" `date` find /oracle/tools/$ORACLE_SID/log/alertlog_*.log -mtime +7 -exec rm{} \;
echo "Purging arch log files on" `date` find /oracle/tools/$ORACLE_SID/log/archlog_*.log -mtime +7 -exec rm{} \;
echo "Purging alert files in $OBACKUP/backup_old on " `date` find /opt1/$ORACLE_SID/backup_old/alert* -mtime +7 -exec rm {} \; echo "Purging alert files in $OALERT on " `date` find /oracle/oradata/$ORACLE_SID/trace/bdump/alert* -mtime +7 -execrm {} \;
If you have any questions, just email me.
>>> Michael.Ma_at_exodus.net 5/31/2000 >>>
Dear DBA,
I would appreciate had any Unix script to delete the old archive log files.
Thanks for the advance,
Michael Ma.
-- Author: Michael Ma INET: Michael.Ma_at_exodus.net 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). -- Author: Kristen Cameron INET: cameronkgd_at_inac.gc.ca 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 mayReceived on Thu Jun 01 2000 - 15:29:33 CDT