The backup manager RMAN provides the configure retention policy command to set the backup storage POLICY, that is, how long the backup file is retained. RMAN identifies the backup files that have exceeded the time as obsolete (obsolete ). Command report obsolete and delete obsolete are used to view OBSOLETE files and delete obsolete files respectively. RMAN tracks the backup data files, control files, and archive log files, and determines which need to be saved and which need to be marked as obsolete. However, RMAN does not automatically delete obsolete backup files.
Different from expired. Whether the backup file is discarded is determined by the backup retention policy. The discarded backup file is no longer needed in media restoration (not needed ). Outdated files are no longer available (not found). You can use the CROSSCHECK command to view outdated information.
In addition to backup files that affect data files and control files, backup retention policies also affect backup files for archiving logs. RMAN first confirms whether the backup results of data and control files need to be discarded, and then marks the archive log backup before the earliest time of data file backup and control file backup as obsolete.
There are two methods to define a backup retention policy:
1. Use the configure retention policy to recovery window command.
Example: RMAN> configure retention policy to recovery window of 5 DAYS;
My current time is June 11. If I set the above backup retention policy and perform a backup, the backup will be marked as obsolete after June 16.
2. Use the configure retention policy redundancy command.
Example: RMAN> configure retention policy redundancy 3;
If the preceding settings are performed, after the three backups are completed, the first backup result will be marked as obsolete when the fourth backup is completed. The default backup retention policy of Oracle11G is set using this method, and REDUNDANCY is 1. You can use the configure retention policy clear command to set the recovery POLICY to the default value. You can also use the configure retention policy to none command TO set the POLICY. In this case, report obsolete and delete obsolete will not regard any backup files as OBSOLETE.