Time for action – verifying synchronization between the primary and standby databases
By using the following steps, you can control whether the standby database is synchronized with primary:
On the standby database, query the
V$ARCHIVED_LOG
view for the archived and applied sequences.For the last archived sequence, use the following:
SQL> SELECT MAX(SEQUENCE#) FROM V$ARCHIVED_LOG; MAX(SEQUENCE#) -------------- 145
For the last applied sequence, use the following:
SQL> SELECT MAX(SEQUENCE#) FROM V$ARCHIVED_LOG WHERE APPLIED='YES'; MAX(SEQUENCE#) -------------- 144
From the preceding two queries, we see that the latest sequence,
145
, is being archived or written into the standby redo logfiles. There's expected to be a lag of one sequence between archived and applied columns.Check the status of the latest log sequence.
SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#; SEQUENCE# APPLIED ---------- --------- 140 YES 141 YES ...