Doubts over v$log and v$archived_log in standy vs primary perspective
Dan AJan 9 2010 — edited Jan 9 2010Hi.
Our standby has been falling behind our primary. Oracle SR engineer tells me it is a network issue, after analysing alert and trace files.
Here is the history:
I had written a script, in monitoring both databases, by checking the difference on both environments using v$log_history: if the max sequence # were different, we were alerted.
Then I had to change this as the primary was "reincarnated". So thereafter I have been using the difference between v$log.
Herein lies my doubt:
what is the difference between using v$log and v$archived_log? Yes, the Oracle documentation explains:
V$ARCHIVED_LOG=Displays historical archived log information from the control file.
V$LOG=Displays all redo log groups for the database and indicates which need to be archived
My question is based upon the following: here are the archived logs present on the primary, and the result of my two queries using the aforesaid views:
-rw-r----- 1 oraprod dba 165335552 Jan 9 00:25 o1_mf_1_984_5nhm8lt5_.arc
-rw-r----- 1 oraprod dba 246824960 Jan 9 03:27 o1_mf_1_985_5nhxxpoo_.arc // can see the last archived log is 985.
sqlplus / as sysdba
SQL> select max (sequence#) from v$log;
MAX(SEQUENCE#)
--------------
986 // why is this 986 and not 985 ?. I cant query the v$archived_log view since it gives me 43901 and the standby has been reset recently.
On the standby:
-rw-r----- 1 oraprod dba 246824960 Jan 9 03:27 log_1_985_704816194.dbf // archived log is 985
sqlplus / as sysdba
SQL> select max (sequence#) from v$log;
MAX(SEQUENCE#)
--------------
986
SQL> select max (sequence#) from v$archived_log;
MAX(SEQUENCE#)
--------------
985
So, my issue is which view should I be querying to ensure that my databases are in synch?
Thanks for your time.
10.2.0.4, Linux 4.
DA