Tuesday, 29 March 2016

Redundancy and Recovery window in RMAN

Redundancy and Recovery window in RMAN


There is two mutually exclusive options for setting a retention policy; redundancy and recovery window.

To set Recovery Window of 3 days,
RMAN>CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3 DAYS;
Whenever retention policy is set to recovery window of 3 days then rman retains all information and backup data though which it can go to any point within 3 days from current date.


To set Recovery Window of redundancy 3 copies,
RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
Whenever retention policy is set to redundancy of 3 copies the rman at least retains latest 3 copies of each datafile. If I took 4th backup of datafile 1 then 1st backup of datafile 1 become obsolete.



RMAN> CONFIGURE RETENTION POLICY TO NONE;
You can disable the retention policy by using this command


Note : If you don’t have flash recovery configured then the database does not delete any file even they are obsolete.

·        Obsolete means “not needed,” whereas expired means “not found.”

·        A backup becomes obsolete based on retention policy, that it is not needed for recovery.

·        A Backup becomes expired only when RMAN perform CROSSCHECK and can’t find the file. (Assume file is deleted by OS).

 RESTORE Command In RMAN



•RMAN always restore data file as image copy.

•If we simply use RESTORE command then RMAN directs a server session to restore the file to default location that is overwrite the existing file.

•If we use RESTORE command with SET NEWNAME option then RMAN restore the file with specified location.

Example: RUN {
SET NEWNAME FOR DATAFILE ‘/oradata/mydb/system01.dbf’ TO ‘/standby/system01.dbf’;
RESTORE
}

·        RMAN SWITCH command is equivalent to SQL statement ALTER DATABASE RENAME FILE command.
SWITCH command updates the control file. (This is helpful after restoring any data: so that we can notify our Controlfile for New Location)

Example: SWITCH DATAFILE ‘/oradata/mydb/system01.dbf’ TO DATAFILECOPY  ‘/standby/system01.dbf’

Points to Remember :

Ø  If RMAN has a choice between archived redo logs and incremental backups then RMAN always choice incremental backups during recovery.
Ø  RMAN can restore more quickly from image copies than from backup sets.
Ø  If there is no backup exist (During RESTORE) , then RMAN try to re‑create the datafile., It automatically searches other copies of Backup.
Ø  OPTIMIZATION : If a datafile is already present in the correct location and its header contains the expected information, then RMAN does not restore the datafile from backup.
      You can override this by FORCE option.
Ø  RMAN RESTORE … VALIDATE before restore database or any datafile you can verify whether database can successfully restored or not

Ø  An example, Before Performing Backup Check Any Physical or Logical Corruption.


No comments:

Post a Comment