Understanding the Difference Between RMAN Redundancy and Recovery Windows


When it comes to Oracle database backups and recovery, two important concepts to understand are RMAN redundancy and recovery windows. These concepts play a crucial role in ensuring data availability and protection against data loss. In this post, I will explain the difference between RMAN redundancy and recovery windows, and provide examples of RMAN scripts to illustrate their usage.

RMAN Redundancy:
RMAN redundancy refers to the number of copies of backups that are retained in the backup catalog. It determines the level of data protection and allows for recovery in case of backup failures or media corruption. By specifying the redundancy level, RMAN ensures that a certain number of valid backups are available at all times.

Example RMAN Script for Setting Redundancy:
The following RMAN script demonstrates how to set the backup redundancy level to two copies:


RUN {
  CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
  BACKUP DATABASE PLUS ARCHIVELOG;
}

In this example, the CONFIGURE RETENTION POLICY TO REDUNDANCY 2 command ensures that at least two copies of backups are retained in the backup catalog. The subsequent BACKUP DATABASE PLUS ARCHIVELOG command performs a full database backup along with archived redo logs.

Recovery Windows:
Recovery window refers to the duration of time for which backups are available for recovery purposes. It specifies the maximum period within which point-in-time recovery (PITR) can be performed. By setting a recovery window, RMAN automatically manages the retention of backups beyond that duration, ensuring that older backups are deleted or expired.

Example RMAN Script for Setting Recovery Window:
The following RMAN script illustrates how to set the recovery window to 7 days:


RUN {
  CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
  BACKUP DATABASE PLUS ARCHIVELOG;
}

In this example, the CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS command sets the recovery window to 7 days. RMAN will manage the retention of backups older than 7 days automatically. The subsequent BACKUP DATABASE PLUS ARCHIVELOG command performs a full database backup along with archived redo logs.

Difference between RMAN Redundancy and Recovery Windows:
The primary difference between RMAN redundancy and recovery windows lies in their focus. Redundancy ensures the existence of multiple backup copies for data protection, while recovery windows specify the time duration within which backups are retained for recovery purposes.

While redundancy guarantees the availability of a specific number of backup copies, the recovery window controls the retention and expiration of backups based on a time-based criterion. Redundancy provides an extra layer of protection against backup failures or media corruption, whereas recovery windows streamline backup management based on time constraints.


To set both RMAN redundancy and recovery windows simultaneously, you can use the CONFIGURE command in RMAN with appropriate parameters. 

I am setting both redundancy and recovery windows:


RUN {
  CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
  CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
  BACKUP DATABASE PLUS ARCHIVELOG;
}

In this script, the CONFIGURE RETENTION POLICY TO REDUNDANCY 2 command sets the redundancy level to two copies, ensuring that at least two valid backups are retained in the backup catalog. The CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS command sets the recovery window to 7 days, specifying that backups beyond this duration will be managed automatically by RMAN.





If you like please follow and comment