Difficulty in monitoring primary and standby using v$log and v$archived_log
Dan ANov 2 2010 — edited Nov 4 2010Hi Gurus.
I posted something here yesterday about checking primary and standby, and this kid of leads from it.
I am in some difficulty as to how I am to monitor and correctly understand that the primary is in sync with the standby.
I am using this query for the standby:
select MAX (SEQUENCE#), APPLIED FROM V$ARCHIVED_LOG where APPLIED ='YES' GROUP BY APPLIED;
Which gives us the latest applied log (great!).
But on the Primary I am in some trouble:
I cant use v$log for the query since the redo from this log cannot be made available on the Standby as it has not been archived.
The query I use for v$log is:
select max(sequence#) from v$log where archived= 'YES';
(no good, as often one behind Standby and this is normal)
Which other view to use then? I have tried v$log_history, but unfortunately the primary was re-incarnated, so a query like this:
select max(sequence#) from v$log_history;
Returns:
MAX(SEQUENCE#)
--------------
43901
Is there any other view that I can use to query the archived logs on the primary that will be good enough for me to compare with the query on the standby?
Thanks.
10.2.0.4
Linux Red Hat 4