Monitor Standby Site

**SCN and additional information stored in the Standby's data file headers


SQL>  select status, to_char(checkpoint_change#, '999999999999999') as checkpoint_change#, to_char(checkpoint_time, 'DD-MON-YYYY HH24:MI:SS') as checkpoint_time,count(*), fuzzy 
from v$datafile_header
group by status,checkpoint_change#,checkpoint_time, fuzzy;

STATUS  CHECKPOINT_CHANG CHECKPOINT_TIME        COUNT(*) FUZ
------- ---------------- -------------------- ---------- ---
ONLINE     5976304015881 07-AUG-2011 04:31:06         44 NO


**Distinct SCNs stored in the Standby's data file headers

SQL> select distinct to_char(fhscn, '99999999999999999999') as Stby_datafile_hdr_SCN
from X$KCVFH;
STBY_DATAFILE_HDR_SCN
---------------------
        5976304015881


**Next archived log sequence number the Standby needs to apply

SQL> select distinct inst_id, fhrba_seq, count(*) from X$KCVFH group by INST_ID,FHRBA_SEQ;
   INST_ID  FHRBA_SEQ   COUNT(*)
---------- ---------- ----------
         1      16683         44


**Use the LOWEST SCNs stored in the Standby's data file headers to extract this backup from the Primary database

SQL> select min(to_char(fhscn, '99999999999999999999')) as SCN_to_be_used from X$KCVFH;
SCN_TO_BE_USED
---------------------
        5976304015881

No comments:

Post a Comment