This document contains SQL statements to:
1. Query the database role, name, open mode, protection mode, and switchover status of the V$DATABASE view.
2. Query statistics from the V$DATAGUARD_STATS view and format the output.
3. Query archived log and log history views to identify the last archived sequence, last applied sequence, and sequence gap for each thread.
This document contains SQL statements to:
1. Query the database role, name, open mode, protection mode, and switchover status of the V$DATABASE view.
2. Query statistics from the V$DATAGUARD_STATS view and format the output.
3. Query archived log and log history views to identify the last archived sequence, last applied sequence, and sequence gap for each thread.
This document contains SQL statements to:
1. Query the database role, name, open mode, protection mode, and switchover status of the V$DATABASE view.
2. Query statistics from the V$DATAGUARD_STATS view and format the output.
3. Query archived log and log history views to identify the last archived sequence, last applied sequence, and sequence gap for each thread.
PROTECTION_LEVEL, SWITCHOVER_STATUS FROM V$DATABASE;
set lines 300 pages 300
col value for a30 select * from v$dataguard_stats;
select to_char(sysdate,'DD-MON-YYYY HH24:MI:SS') time,
a.thread#, (select max(sequence#) from v$archived_log where archived='YES' and thread#=a.thread#) archived, max(a.sequence#) applied, (select max(sequence#) from v$archived_log where archived='YES' and thread#=a.thread#)-max(a.sequence#) gap from v$archived_log a where a.applied='YES' group by a.thread#;
APPL.SEQUENCE# "Last Sequence Applied",(ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference" FROM (SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE(THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX (FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#))ARCH, (SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;
alter database recover managed standby database cancel;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;