Hi all,
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';
release channel;

1/ how do I expire the backups I deem old?
2/Can I expire and delete in one scripts?
3/ Any sample script?