Subscribe YouTube Channel For More Live Tutorials

Oracle Dataguard - Max Availability - with Real Time Apply - Read Only

Enable Real Time Apply - Oracle Dataguard

Oracle Dataguard - Max Availability - with Real Time Apply - Read Only

Apply services automatically apply redo to standby databases to maintain synchronization with the primary database and allow transactionally consistent access to the data.

By default, apply services waits for a standby redo log file to be archived before applying the redo that it contains. However, you can enable real-time apply, which allows apply services to apply the redo in the current standby redo log file as it is being filled.

Using Real-Time Apply to Apply Redo Data Immediately

If the real-time apply feature is enabled, then apply services can apply redo data as it is received, without waiting for the current standby redo log file to be archived.

This results in faster switchover and failover times because the standby redo log files have already been applied to the standby database by the time the failover or switchover begins. It also enables real-time reporting on an Oracle Active Data Guard standby by keeping it more closely synchronized with the primary database.

Description of Figure 8-1 follows

On Primary Database

SQL> select status,instance_name,database_role,protection_mode from v$database,v$instance;
SQL> select thread#,group#,bytes/1024/1024,status from v$log;
select thread#,max(sequence#) from v$archived_log where applied='YES' group by thread#;

SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP MOUNT;
SQL> ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE AVAILABILITY;
SQL> SELECT PROTECTION_MODE FROM V$DATABASE;
SQL> ALTER DATABASE OPEN;
SQL> select status,instance_name,database_role,protection_mode from v$database,v$instance;

SQL> alter system set log_archive_dest_2='SERVICE=std LGWR AFFIRM SYNC DB_UNIQUE_NAME=std VALID_FOR=(ALL_LOGFILES,PRIMARY_ROLE)' scope=both;

On Standby Database

Change - Real Time Apply - Read only with apply

SQL>alter database recover managed standby database cancel;
SQL>alter database recover managed standby database using current logfile disconnect; (12c 12.1.0.1 is deprecated) so use

sql>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;  (use this instead of above command)
SQL> select recovery_mode,open_mode,database_mode from v$archive_dest_status;

RECOVERY_MODE DATABASE_MODE
----------------------- ---------------
MANAGED READ ONLY WITH APPLY OPEN_READ-ONLY