Thursday, May 5, 2011

Delaying the Application of Redo


Specifying a Time Delay for the Application of Archived Redo Log Files
In some cases, you may want to create a time lag between the time when redo data is received from the primary site and when it is applied to the standby database. You can specify a time interval (in minutes) to protect against the application of corrupted or erroneous data to the standby database. When you set a DELAY interval, it does not delay the transport of the redo data to the standby database. Instead, the time lag you specify begins when the redo data is completely archived at the standby destination.

Note:
If you define a delay for a destination that has real-time apply enabled, the delay is ignored.

Specifying a Time Delay
You can set a time delay on primary and standby databases, as follows:
  • On the primary database and physical standby databases, use the DELAY=minutes attribute of the LOG_ARCHIVE_DEST_n initialization parameter to delay applying archived redo log files to the standby database. The default setting for this attribute is NODELAY. If you specify the DELAY attribute without specifying a value, then the default delay interval is 30 minutes.
  • On logical standby databases, use the DBMS_LOGSTDBY.APPLY_SET procedure.
Setting up a time delay on a standby database supersedes any time delay specified on the primary database. For example:
SQL> RECOVER MANAGED STANDBY DATABASE DELAY <minutes>
 
In a configuration with multiple standby databases, setting a time lag on more than one standby database can be very useful. For example, you can set up a configuration where each standby database is maintained in varying degrees of synchronization with the primary database.
Canceling a Time Delay
You can cancel a specified delay interval as follows:
  • On the primary database and physical standby databases, use the NODELAY keyword of the RECOVER MANAGED STANDBY DATABASE clause:
·         SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE NODELAY;
·          
  • On logical standby databases, specify the following PL/SQL command:
SQL> ALTER DATABASE START LOGICAL STANDBY APPLY NODELAY;

No comments: