Query to check database is Sync

Fire below query from Primary side:

set scan on
set feed off
set linesize 200
BREAK ON ROW SKIP 1
column thread format a6;
column "PR - Archived" format a13;
column "STBY - Archived" format a15;
column "STBY - Applied" format a14;
column "Shipping GAP (PR -> STBY)" format a25;
column "Applied GAP (STBY -> STBY)" format a26;
--ACCEPT DEST PROMPT 'Enter the Standby Archive Log Destination : '
select * from (
select
lpad(t1,4,' ') "Thread",
lpad(pricre,9,' ') "PR - Archived",
lpad(stdcre,10,' ') "STBY - Archived",
lpad(stdnapp,9,' ') "STBY - Applied",
lpad(pricre-stdcre,13,' ') "Shipping GAP (PR -> STBY)",
lpad(stdcre-stdnapp,15,' ') "Applied GAP (STBY -> STBY)"
from
(select max(sequence#) stdcre, thread# t1 from v$archived_log where standby_dest='YES' and resetlogs_id in (select max(RESETLOGS_ID) from v$archived_log) and thread# in (1,2,3,4,5,6,7,8) group by thread#) a ,
(select max(sequence#) stdnapp, thread# t2 from v$archived_log where standby_dest='YES' and resetlogs_id in (select max(RESETLOGS_ID) from v$archived_log) and thread# in (1,2,3,4,5,6,7,8) and applied='YES' group by thread#) b,
(select max(sequence#) pricre, thread# t3 from v$archived_log where standby_dest='NO' and resetlogs_id in (select max(RESETLOGS_ID) from v$archived_log) and thread# in (1,2,3,4,5,6,7,8) group by thread#) c
where a.t1=b.t2 and b.t2=c.t3 and c.t3=a.t1) order by 1
/
set feed on
break on off

 

Please share If you like..Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on Yummly

4 Comments

Add a Comment
  1. My Primary is in Sync..thanks..

  2. Too many coimlmpents too little space, thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

Fariddin Shaikh's Oracle DBA Blog © 2016 Being DBA
Go Back