Databases Reference
In-Depth Information
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)?
If you're scripting the procedure, you can specify the delete not to prompt for input:
RMAN> delete noprompt obsolete;
I usually have the DELETE NOPROMPT OBSOLETE command coded into the shell script that backs up the database.
This instructs RMAN to delete any obsolete backups and obsolete archive redo logs, as specified by the retention
policy (see the section “Segueing from Decisions to Action,” later in this chapter, for an example of how to automate
the deleting of obsolete backups with a shell script).
Clearing the Retention Policy
The default retention policy is redundancy of 1. You can completely disable the RMAN retention policy via the
TO NONE command.
RMAN> configure retention policy to none;
When the policy is set to NONE , no backups are ever considered obsolete and therefore cannot be removed via the
DELETE OBSOLETE command. This normally is not the behavior you want. You want to let RMAN delete backups per a
retention policy based on a window or number of backups.
To set the retention policy back to the default, use the CLEAR command:
RMAN> configure retention policy clear;
 
Search WWH ::




Custom Search