Data Guard script


 
SELECT dest_name,status,type,destination,ARCHIVED_THREAD#, ARCHIVED_SEQ#, APPLIED_THREAD#, APPLIED_SEQ# FROM V$ARCHIVE_DEST_STATUS where rownum <3

SELECT (SELECT ARCHIVED_SEQ#
 FROM V$ARCHIVE_DEST_STATUS
 WHERE dest_name LIKE '%DEST_1%' AND ROWNUM < 2) -
 (SELECT APPLIED_SEQ#
 FROM V$ARCHIVE_DEST_STATUS
 WHERE dest_name LIKE '%DEST_2%')  from dual

SELECT NAME, CREATOR, SEQUENCE#, APPLIED, COMPLETION_TIME 
FROM V$ARCHIVED_LOG order by 3 desc;

SELECT (SELECT MAX (sequence#)
 FROM V$ARCHIVED_LOG
 WHERE name LIKE '%+ARCH%') -
 (SELECT MAX (sequence#)
 FROM V$ARCHIVED_LOG
 WHERE name LIKE '%ANAR_DRC%' AND applied = 'YES')  FROM DUAL;

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: