Skip to main content

RMAN RETENTION POLICIES - REDUNDANCY AND RECOVERY WINDOW


RECOVER WINDOW AND REDUNDANCY

The redundancy retention policy defines a fixed number of backups that need to be retained by RMAN. If there are a number of backups later than the number defined by the retention policy, then those backups can be deleted using the DELETE OBSOLETE command, which we will discuss in the next section.

To set a redundancy retention policy, use the configure retention policy command, as shown here:

RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 7;

RMAN> show all;
RMAN configuration parameters are:
RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 1; -

NOTE: Here it will keep only 1 backup copy. Rest all previous backups marked as OBSOLETE

RMAN> REPORT OBSOLETE;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of obsolete backups and copies
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log          9      26-MAY-15          D:\XE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\ARCHIVELOG\2015_05_26\O1_MF_1_19_BP8BD2MV_.ARC
Archive Log          10     26-MAY-15          D:\XE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\ARCHIVELOG\2015_05_26\O1_MF_1_20_BP8BFSC1_.ARC
Archive Log          11     26-MAY-15          D:\XE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\ARCHIVELOG\2015_05_26\O1_MF_1_21_BP90WVBV_.ARC
Backup Set           24     26-MAY-15
  Backup Piece       24     26-MAY-15          D:\DATA_XE\RMANC-2761439438-20150526-08

RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 4;

NOTE: Here it will keep up to four backup sets. Rest all backups marked as OBSOLETE.

old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 4;
new RMAN configuration parameters are successfully stored

RMAN> REPORT OBSOLETE;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 4
no obsolete backups found


RECOVERY WINDOW:

The recovery window retention policy is used to ensure that a backup is available that will facilitate a recovery within the defined time window. For example, if the recovery window is set to seven days, then no backup will be reported as obsolete unless it is older than 7 days, the defined recovery window retention time.

To set a recovery window retention policy, use the CONFIGURE RETENTION POLICY command, as shown in the following example:

RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS; - Default value

NOTE: In this case, we have configured a retention policy of seven days. When the DELETE OBSOLETE command is executed, only backups older than seven days will be reported as obsolete.

Note: If the control_file_record_keep_time database parameter value is less than the time set for the retention policy, you will need to use a recovery catalog.


RMAN> REPORT OBSOLETE;
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 1 days
no obsolete backups found


RMAN> show all;

RMAN configuration parameters are:
RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;

RMAN> configure retention policy to recovery window of 0 days;

old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 0 DAYS;
new RMAN configuration parameters are successfully stored

RMAN> report obsolete;

NOTE: Here it will show all previous days backups.

RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 0 days
Report of obsolete backups and copies
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log          9      26-MAY-15          D:\XE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\ARCHIVELOG\2015_05_26\O1_MF_1_19_BP8BD2MV_.ARC
Archive Log          10     26-MAY-15          D:\XE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\ARCHIVELOG\2015_05_26\O1_MF_1_20_BP8BFSC1_.ARC
Archive Log          11     26-MAY-15          D:\XE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\ARCHIVELOG\2015_05_26\O1_MF_1_21_BP90WVBV_.ARC
Backup Set           23     26-MAY-15
  Backup Piece       23     26-MAY-15          D:\DATA_XE\RMANXE_0VQ7UB17_1_1XE880749607
RMAN> configure retention policy to none;

This would disable the retention policy settings. However, doing so would stop the report obsolete and delete obsolete commands from marking any of your previously done backups as obsolete.


RMAN> DELETE OBSOLETE; 

RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 0 days
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Archive Log          9      26-MAY-15          D:\XE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\ARCHIVELOG\2015_05_26\O1_MF_1_19_BP8BD2MV_.ARC
Archive Log          10     26-MAY-15          D:\XE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\ARCHIVELOG\2015_05_26\O1_MF_1_20_BP8BFSC1_.ARC
Archive Log          11     26-MAY-15          D:\XE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\ARCHIVELOG\2015_05_26\O1_MF_1_21_BP90WVBV_.ARC
Backup Set           21     26-MAY-15
  Backup Piece       21     26-MAY-15          D:\DATA_XE\RMANXE_0TQ7UA58_1_1XE880748712291
Backup Set           23     26-MAY-15
  Backup Piece       23     26-MAY-15          D:\DATA_XE\RMANXE_0VQ7UB17_1_1XE880749607311
Backup Set           24     26-MAY-15
  Backup Piece       24     26-MAY-15          D:\DATA_XE\RMANC-2761439438-20150526-08
Backup Set           25     26-MAY-15
  Backup Piece       25     26-MAY-15          D:\DATA_XE\RMANXE_11Q7UBSU_1_1XE880750494331
Backup Set           26     26-MAY-15
  Backup Piece       26     26-MAY-15          D:\DATA_XE\RMANC-2761439438-20150526-09
Archive Log          12     27-MAY-15          D:\XE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\ARCHIVELOG\2015_05_27\O1_MF_1_22_BPB460PB_.ARC
Archive Log          13     27-MAY-15          D:\XE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\ARCHIVELOG\2015_05_27\O1_MF_1_23_BPBK37B9_.ARC
Archive Log          14     27-MAY-15          D:\XE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\ARCHIVELOG\2015_05_27\O1_MF_1_24_BPBO8317_.ARC
Archive Log          15     27-MAY-15          D:\XE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\ARCHIVELOG\2015_05_27\O1_MF_1_25_BPC22X9S_.ARC
Archive Log          16     27-MAY-15          D:\XE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\ARCHIVELOG\2015_05_27\O1_MF_1_26_BPC7MBJB_.ARC
Backup Set           29     27-MAY-15
  Backup Piece       27     27-MAY-15          D:\DATA_XE\RMANXE_15Q80FE4_1_1XE880819652371

Do you really want to delete the above objects (enter YES or NO)? Yes – Press yes to delete all the above backup files.

NOTE: The delete obsolete command also can take parameters to define a recovery window or backup redundancy that is different from the existing policy. If your default recovery window is seven days and you want to remove backups that are five days old, then you could issue this command:


RMAN> DELETE OBSOLETE RECOVERY WINDOW OF 5 DAYS;

RMAN> SHOW RETENTION POLICY;

RMAN configuration parameters are:
RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 0 DAYS;

Comments

Popular posts from this blog

Registering The Database to RMAN catalog database:

Registering The Database to RMAN catalog database: Need to start RMAN as follows: RMAN target=sys/password@database_to_backup rcvcat=sys/password@recovery_catalog_database Another variation on the command, if the recovery catalog and the database were on the same server, might be as shown: oraenv ORACLE_SID = [KKUY] ? KKUY RMAN rcvcat=sys/password@recovery_catalog_database RMAN> connect target Recovery Manager: Release 8.0.5.1.0 - Production RMAN-06005: connected to target database: KKUY RMAN-06008: connected to recovery catalog database Use the below command to register the database. RMAN>register database; Want to verify if a database is registered in the recovery catalog. To do this, connect to RMAN and issue the command LIST INCARNATION OF DATABASE. RMAN> list incarnation of database; RMAN-03022: compiling command: list RMAN-06240: List of Database Incarnations RMAN-06241: DB Key Inc Key DB Name DB ID      CUR Reset SCN   Reset Time RMAN

ORA-39014: One or more workers have prematurely exited.ORA-00018: maximum number of sessions exceeded

ERROR: I was Performing a full database import and during the import I faced the below error. ORA-39014: One or more workers have prematurely exited. ORA-39029: worker 6 with process name "DW07" prematurely terminated ORA-31672: Worker process DW07 died unexpectedly. Job "SYSTEM"."SYS_IMPORT_FULL_04" stopped due to fatal error at 00:59:40 ORA-39014: One or more workers have prematurely exited. SOLUTION:  Run the import with fewer parallel processes, like PARALLEL=2 instead of 8. I was able to run the import successfully. NOTE 1: This errors occurs when there are less session allocation in the database. check the session,process parameters and increase them accordingly. To avoid such errors again. NOTE 2 : Note: Increasing processes parameter increases the amount of shared memory that needs to be reserved & the OS must be configured to support the larger amount of shared memory. So here we first need to increase the Memory & SG