dataguard standby


select * from v$log;
select * from v$log;
select * from v$standby_log;
select * from v$archive_dest;
select * from v$managed_standy;
select * from v$dataguard_stats;
select * from v$dataguard_status order by timestamp desc;

select * from V$DATAGUARD_CONFIG;

SELECT DB_NAME,
       HOSTNAME,
       LOG_ARCHIVED,
       LOG_APPLIED,
       APPLIED_TIME,
       LOG_ARCHIVED - LOG_APPLIED LOG_GAP
  FROM (SELECT NAME DB_NAME FROM V$DATABASE),
       (SELECT UPPER (
                  SUBSTR (
                     HOST_NAME,
                     1,
                     (DECODE (INSTR (HOST_NAME, '.'),
                              0, LENGTH (HOST_NAME),
                              (INSTR (HOST_NAME, '.') - 1)))))
                  HOSTNAME
          FROM V$INSTANCE),
       (SELECT MAX (SEQUENCE#) LOG_ARCHIVED
          FROM V$ARCHIVED_LOG
         WHERE DEST_ID = 1 AND ARCHIVED = 'YES'),
       (SELECT MAX (SEQUENCE#) LOG_APPLIED
          FROM V$ARCHIVED_LOG
         WHERE DEST_ID = 2 AND APPLIED = 'YES'),
       (SELECT TO_CHAR (MAX (COMPLETION_TIME), 'DD-MON/HH24:MI') APPLIED_TIME
          FROM V$ARCHIVED_LOG
         WHERE DEST_ID = 2 AND APPLIED = 'YES');
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: