Tuesday, January 31, 2012

Delete Old archives which are more than 3 days old in oracle database



Below shell scrip Can be used for deleting old archives from oracle database which are > 3 days old
Description of each value
/bin/find: Location of find executable
/opt/DB_ARCH/  : Location to be searched




Remove  Archived Logs after 3 days
--------------------------------------------------------
00 07 * * * /bin/ksh -c '/bin/find /opt/DB_ARCH/ -type f -mtime +3 -name "arch*.arc" -print -exec rm {} \;' 2>&1  >>/opt/DB_ARCH/archives.deleted.log


This script can also be customized to delete the traces and other files based on your requirement

No comments:

Post a Comment