Thursday, 18 September 2014
Backup Strategy In A Dataguard Environment : Delete ArchiveLogs Automatically
I have a system like the one show in figure. I want to backup database in primary and standby sites. Also, if there is a problem with shipment from primary to standby, i want to keep archived logs in primary i order to guarantee that when the problem is solved, unshipped archived logs will be shipped to standby. Problem can last more than the time specified with retention policy.
First, Configure RMAN to delete Archivelogs In Primary Database properly :
RMAN -> CONFIGURE ARCHIVELOG DELETION POLICY TO SHIPPED TO
ALL STANDBY BACKED UP <n> TIMES TO DEVICE TYPE <device_type>;
- Ensures that FRA logs are deleted only after being shipped and backed up.
- FRA space reclamation and RMAN delete honor deletion policy.
After that, Configure RMAN to delete Archivelogs In Physical Standby Database.
RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY BACKED UP <n> TIMES TO DEVICE TYPE <device_type>;
or
RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY BACKED UP <n> TIMES TO DEVICE TYPE <device_type>;
Primary backup rcv file :
run {
allocate channel t1 device type disk;
allocate channel t2 device type disk;
backup as copy database;
backup archivelog all;
release channel t1;
release channel t2;
}
allocate channel for maintenance device type disk;
delete copy completed before 'sysdate-1';
crosscheck archivelog all;
crosscheck backup;
delete noprompt force expired backup;
delete noprompt force expired archivelog all;
restore database validate;
validate archivelog all;
restore controlfile validate;
#### delete obsolete; (delete regarding Retention_policy)
release channel;...
Standby backup rcv file (same as primary db):
run {
allocate channel t1 device type disk;
allocate channel t2 device type disk;
backup as copy database;
backup archivelog all;
release channel t1;
release channel t2;
}
allocate channel for maintenance device type disk;
delete copy completed before 'sysdate-1';
crosscheck archivelog all;
crosscheck backup;
delete noprompt force expired backup;
delete noprompt force expired archivelog all;
restore database validate;
validate archivelog all;
restore controlfile validate;
#### delete obsolete;(delete regarding Retention_policy)
release channel;
Subscribe to:
Post Comments (Atom)
does the archived logs got deleted automatically after backup done in primary and standby? If yes, when are they got deleted? Is it controlled by Oracle itself?
ReplyDelete