Maintenance Of Archive logs On Standby Databases

 Maintenance Of Archivelogs On Standby Databases


Maintenance of archivelogs which are already applied on standby database in Oracle 10g and above From Oracle 10g onwards, RMAN has a specific configuration for archivelog deletion policy i.e. ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY


This parameter can be set on primary and standby databases.  To enable automatic maintenance of the archivelogs on standby perform the below steps on standby database :

In a dataguard configuration, the archivelogs from the FRA will be automatically purged when the following conditions are met by the database. If you need it purged in at the Primary site, set it on Primary database.


Step1: Prior to 11g, if not using mandatory archivelog destinations, the database (primary and standby) must be restarted with the following parameter:       

SQL> alter system set "_log_deletion_policy"='ALL' scope=spfile;


Step 2 : Enable the flash recovery area on the standby database so that all the archivelogs are shipped in the flash recovery area.


Example : 

To enable Flash Recovery Area and to allow the archivelogs to be shipped to Flash Recovery Area set the below parameters

SQL> alter system set DB_RECOVERY_FILE_DEST='/disk1/FRA';

SQL> alter system set DB_RECOVERY_FILE_DEST_SIZE=80G;

SQL> alter system set  LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST';


Step 3 : Set the parameter Archive log deletion policy to applied on standby


Example :

RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;


Note : With the above settings whenever there is a space pressure in Flash Recovery Area all the archivelogs that are applied on standby database will be automatically deleted.  

To list the obsolete objects, run the following query:

RMAN> SHOW RETENTION POLICY

RMAN> REPORT OBSOLETE;


Step 4: There is space pressure in the FRA when an archivelog is automatically deleted from the FRA, you will see this in the database's alert.log:

Sat Jun 18 01:00:32 2011

Deleted Oracle managed file /opt/app/oracle/FRA/ORA102/archivelog/2011_05_30/o1_mf_1_151_6y71q675_.arc

Deleted Oracle managed file /opt/app/oracle/FRA/ORA102/archivelog/2011_05_31/o1_mf_1_151_6y87pzg4_.arc

Comments

Popular posts from this blog

How to Solve - "WAIT FOR EMON PROCESS NTFNS"

Query Regression - "OR" Transformation Oracle 19c

ORA - 12537: TNS: connection closed