Question: How do we Set A Retention Policy For Tape Backups And Disk Backups Differently? For example, setting the tape retention policy to 14 days while setting it to 3 days for the disk backups.
Step 1: Set the retention policy.
RMAN currently only allows one retention policy. The retention policy should be set to 14 days.
RMAN> configure retention policy to recovery window of 14 days;
This retention policy can be set to a desired number of days. Rather than storing the backup for the number of days that are mentioned in the policy, it calculates the Point Of Recovery (POR) which includes the number of days mentioned and the current date. To illustrate this further, let’s take an example of the present date, February 8, and set the recovery window to 3 days. This means that on February 11, the backup done on February 8 would be marked as obsolete. This policy won’t place any restrictions on the number of copies that can be kept as usable in the POR, as is done in the case of the redundancy option.
Step 2: Move the backups from disk to tape to meet the specified disk retention policy. This must be done manually.
The following command will move the backups from disk to tape and delete the original backup copy from disk.
RMAN> backup device type sbt backupset completed before 'sysdate-2' delete input;
The time specified may be changed depending which backupsets will be moved to tape and deleted from disk. The retention policy guarantees that the backups will not be marked as obsolete unless they meet the specified retention policy.
Disable Retention policy
If, for some reason, we are not satisfied with the customized retention policy and want to clear it off to return to its default value, we can use the CONFIGURE command with the option CLEAR, as shown in the following command line:
RMAN>CONFIGURE RETENTION POLICY CLEAR;
If we want to completely disable it, we can use the command CONFIGURE, as shown in the following command line:
RMAN> CONFIGURE RETENTION POLICY TO NONE;