Database Reference
In-Depth Information
13. Configuring RMAN's Backup Retention Policy
RMAN retention policies allow you to specify how long you want to retain backups. RMAN has two mutually exclusive
methods of specifying a retention policy:
Recovery window
Number of backups (redundancy)
Recovery Window
With a recovery window, you specify a number of days in the past for which you want to be able recover to any point
in that window. For example, if you specify a retention policy window of 5 days, then RMAN doesn't mark as obsolete
backups of data files and archive redo logs that are required to be able to restore to any point in that 5-day window:
RMAN> configure retention policy to recovery window of 5 days;
For the specified recovery, RMAN may need backups older than the 5-day window because it may need an older
backup to start with to be able to recover to the recovery point specified. For example, suppose your last good backup
was made 6 days ago, and now you want to recover to 4 days in the past. For this recovery window, RMAN needs the
backup from 6 days ago to restore and recover to the point specified.
Redundancy
You can also specify that RMAN keep a minimum number of backups. For instance, if redundancy is set to 2, then
RMAN doesn't mark as obsolete the latest two backups of data files and archive redo log files:
RMAN> configure retention policy to redundancy 2;
I find that a retention policy based on redundancy is easier to work with and more predictable with regard to how
long backups are retained. If I set redundancy to 2, I know that RMAN won't mark as obsolete the latest two backups.
In contrast, the recovery window retention policy depends on the frequency of the backups and the window length to
determine whether a backup is obsolete.
Deleting Backups, Based on Retention Policy
You can report on backups that RMAN has determined to be obsolete per the retention policy, as follows:
RMAN> report obsolete;
To delete obsolete backups, run the DELETE OBSOLETE command:
RMAN> delete obsolete;
You're prompted with this:
Do you really want to delete the above objects (enter YES or NO)?
 
Search WWH ::




Custom Search