Removing archivelogs once applied from primary
785045Sep 16 2010 — edited Sep 28 2010I have 11.2 DataGuard setup with a single physical standby. I have the broker configured and the observer working. Failover and switchover work fine.
I am running backups to disk from my standby.
I would like to get my RMAN rules set appropriately on my primary so that I can get rid of archived logs as they are no longer needed – once applied.
• I set the standby destination as mandatory like:
SQL> show parameter archive_dest_2
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_2 string service="stnbydb" LGWR SYNC AF
FIRM delay=0 compression=disab
le max_failure=0 max_connectio
ns=1 reopen=300
db_unique_name="stnbydb" net_t
imeout=30 valid_for=(all_logfi
les,primary_role) mandatory
• And I set the archive log deletion policy on the primary to:
RMAN configuration parameters for database with db_unique_name PRIMDB are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/app/oracle/backup/%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/app/oracle/backup/%U';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE DB_UNIQUE_NAME 'primdb' CONNECT IDENTIFIER 'primdb';
CONFIGURE DB_UNIQUE_NAME 'stnbydb' CONNECT IDENTIFIER 'stnbydb';
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_primdb.f'; # default
• So I thought that once a log was applied and archived, it would get deleted. Not so. I suppose this is somewhat due to the fact that my primary is not associated with the disk backups of the standby.
• Besides manually deleting the archived logs on the primary is there an RMAN configuration which will actually cause them to be deleted once applied? That’s my question. Having a deletion policy sounds like a solution but it doesn’t automate any deletion of the logs. As an interim solution I am just running an RMAN script daily to delete the archivelogs.
RMAN>delete noprompt archivelogs until time ‘sysdate -3;