What is Retention Policy in RMAN ?
Setting the RETENTION POLICY in RMAN keep track about the backup files and tells the report whether they are obsoleted and whether it is needed to backup the database or datafile.
Notes:-
To set Retention policy to redundancy 2 copies,
set Retention Policy to Recovery Window of 7 days,
Setting the RETENTION POLICY in RMAN keep track about the backup files and tells the report whether they are obsoleted and whether it is needed to backup the database or datafile.
Notes:-
- If you have flash recovery configured then the database automatically deletes unnecessary files from the flash recovery area based on its internal disk quota rules. The disk quota rules are distinct from the backup retention policy rules, but the database will never delete files in violation of the retention policy to satisfy the disk quota.If you don't have flash recovery configured then the database does not delete any file even they are obsolete.
How to set retention policy in RMAN ?
The configuration parameter RETENTION POLICY can be set by CONFIGURE RETENTION POLICY TO ....
What is the use of crosschek and obsolete command ?
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. (A most common is file is deleted by OS). Obsolete means "not needed," whereas expired means "not found."
Issue the following RMAN command to crosscheck backup of an Oracle Database,
RMAN> crosscheck backup of database;
using channel ORA_DISK_1
crosschecked backup piece: found to be ‘EXPIRED’
backup piece handle=D:\STAGE\RACDEVD1_503\DATAFILE_BACKUP recid=79 stamp=475839783
crosschecked backup piece: found to be ‘EXPIRED’
backup piece handle=D:\STAGE\RACDEVD1_504\DATAFILE_BACKUP recid=137 stamp=475839784
crosschecked backup piece: found to be ‘AVAILABLE’
backup piece handle=D:\DGSTAGE\DPLCU5L5_1_1 recid=132 stamp=475839755
crosschecked backup piece: found to be ‘AVAILABLE’
backup piece handle=D:\DGSTAGE\DQLCU62F_1_1 recid=133 stamp=475839756Crosschecked 4 objects
As we see the RMAN crosscheck command compares the RMAN catalog entries with the actual OS files and reports to locate "expired" or "obsolete" RMAN catalog entries.
Once a RMAN crosscheck identified expired, deleted entries you can run an RMAN delete command to remove these entries to synchronize the RMAN catalog / controlfile with the real database files:
RMAN> delete expired backup;
Identify which backups are obsolete and no longer needed for recovery
RMAN> delete expired backup;
Identify which backups are obsolete and no longer needed for recovery
RMAN> REPORT OBSOLETE;
Delete obsolete backup information from RMAN repository.
RMAN> DELETE OBSOLETE;
Delete obsolete backup information from RMAN repository.
RMAN> DELETE OBSOLETE;
How can we set retention policy in RMAN ?
There is two mutually exclusive options for setting a retention policy , redundancy and recovery window.
To set Retention policy to redundancy 2 copies,
RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
set Retention Policy to Recovery Window of 7 days,
RMAN>CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
Whenever retention policy is set to redundancy of 2 copies the rman at least retains latest 2 copies of each datafile. If I took 3rd backup of datafile 3 then 1st backup of datafile 3 become obsolete.
If you specify a recovery window of 7 days. That means rman will not obsolete any backup needed for recovery to any point in the last seven days. Check. But what's the subtle detail?
This comment has been removed by the author.
ReplyDelete