I am looking for a script to delete expired backups in RMAN.
I have been looking at the process and commands to delete but it looks like you would need to delete piece by piece.
I have this script below but it does not delete anything. It looks like you or some other process would need to "expire" the backup before you can delete. or the backup would need to have a status of "expired" first.
allocate channel for maintenance type 'sbt_tape';
crosscheck backup of database completed before 'SYSDATE-5';
delete expired backup of database completed before 'SYSDATE-5';
1/ how do I expire the backups I deem old?
2/Can I expire and delete in one scripts?
3/ Any sample script?
You didn't mention about your OS and Oracle version. If you are using Unix, you can find sample scripts in $ORACLE_HOME/rdbms/demo directory. Make a copy of rman1.sh script and modify it. It will check obsolete rman backups, create the cmd file and execute it.
Let us know if you have any question.