RMAN Expired vs Obsolete Backups
Two terms that are very important when it comes to RMAN backups validation they are
Let's take you trigger an RMAN backup and someone deleted backup set or backup pieces at OS level. The database CONTROFILE has the details of the backup on disk but at OS level the backup file does not exists.
We can run RMAN crosscheck command to check if backup files exists at OS level or not. If the backup files are not found, RMAN will mark it as EXPIRED.
RMAN> crosscheck backup;
The first action a DBA must take is to find out where the backup pieces are. Did a junior DBA move them to different location or different disk due to space issues.
If you can find the backup pieces, put them back into the original location and run crosscheck backup command again via RMAN.
If you are not able to find backup pieces, then you must clear the expired backup entries from RMAN (controlfile). Use below command to delete expired backups
RMAN> delete expired backup;
The general meaning of OBSOLETE is no longer used or required.
RMAN considers backups as OBSOLETE when they are no longer required for database recovery. This is done by one of the RMAN CONFIGURATION parameters.
For example, we set RMAN retention policy to redundancy 4. This means that if we have 5 database backups, the first one will be marked as OBSOLETE because we want to keep 4 copies of RMAN backups.
We use below command to list all the obsolete backups inside RMAN
RMAN> report obsolete;
IF the FRA location is full, then do not worry, RMAN is intelligent, it will overwrite the obsolete backups.
If you find obsolete backups, you can simply delete the backups (as they are no longer needed for recovery)
RMAN> delete obsolete;