Check Standby Database


/* monitor Process activities */

SELECT PROCESS, CLIENT_PROCESS, SEQUENCE#, STATUS FROM V$MANAGED_STANDBY;

/* Determining Which Logs Were Applied to the Standby Database */

SELECT THREAD#, MAX(SEQUENCE#) AS "LAST_APPLIED_LOG"
 FROM V$LOG_HISTORY
 GROUP BY THREAD#;

/* Determining Which Logs Were Applied to the Standby Database of the last 100 – Standby */

select * from 
( SELECT THREAD#, SEQUENCE#, APPLIED FROM V$ARCHIVED_LOG order by SEQUENCE# desc ) where rownum < 100 ;

/* Determining Which Logs Were Not Received by the Standby Site – Primary */

SELECT LOCAL.THREAD#, LOCAL.SEQUENCE# FROM
 (SELECT THREAD#, SEQUENCE# FROM V$ARCHIVED_LOG WHERE DEST_ID=1) LOCAL
 WHERE
 LOCAL.SEQUENCE# NOT IN
 (SELECT SEQUENCE# FROM V$ARCHIVED_LOG WHERE DEST_ID=2 AND
 THREAD# = LOCAL.THREAD#);

/* V$ARCHIVE_DEST The V$ARCHIVE_DEST view describes, for the current instance, all the archived redo log destinations, their current value, mode, and status. */

select * from gV$ARCHIVE_DEST;

/* V$ARCHIVE_DEST_STATUS view displays runtime and configuration information for the archived redo log destinations. */

select * from v$ARCHIVE_DEST_STATUS;
select * from v$ARCHIVE_DEST_STATUS where archived_thread#=applied_thread# and archived_seq#> 0;

/* The V$ARCHIVE_GAP view displays information to help you identify an archive gap. The V$ARCHIVE_GAP view contains the following columns: */ 

select * from v$archive_gap;

/* The V$ARCHIVED_LOG  view displays archived redo log information from the control file, including archived log names. This view contains the following columns: */

select * from v$archived_log;

/* The V$MANAGED_STANDBY  view displays current status information for Oracle database server processes related to physical standby databases in the Data Guard environment. */

select * from V$MANAGED_STANDBY;

/* V$DATAGUARD_STATUS The V$DATAGUARD_STATUS view displays and logs events that would typically be triggered by any message to the alert log or server process trace files. */

select * from v$dataguard_status;
select * from v$log;
select * from v$logfile;
select * from v$log_history order by sequence# desc;
select * from V$STANDBY_LOG;

/* Determine the most recently archived redo log file at each destination. */

SELECT DESTINATION, STATUS, ARCHIVED_THREAD#, ARCHIVED_SEQ#
 FROM V$ARCHIVE_DEST_STATUS
 WHERE STATUS <> 'DEFERRED' AND STATUS <> 'INACTIVE';
SELECT MAX(SEQUENCE#) FROM V$ARCHIVED_LOG;
SELECT MAX(R.SEQUENCE#) LAST_SEQ_RECD, MAX(L.SEQUENCE#) LAST_SEQ_SENT FROM
 V$ARCHIVED_LOG R, V$LOG L WHERE
 R.DEST_ID=2 AND L.ARCHIVED='YES';
About these ads

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

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: