oracle data guard monitor - ghdrako/doc_snipets GitHub Wiki

SELECT
    NAME,
    VALUE
FROM
    V$DATAGUARD_STATS
WHERE
    NAME IN ('transport lag', 'apply lag');

SELECT
    PROCESS,
    STATUS,
    THREAD#,
    SEQUENCE#
FROM
    V$MANAGED_STANDBY
WHERE
    PROCESS LIKE 'MRP%';

alter system switch logfile;

set linesize 150
col member for a50
SELECT GROUP#, STATUS, MEMBER, TYPE FROM V$LOGFILE  ORDER BY GROUP#;


SELECT DEST_ID, STATUS, ERROR FROM V$ARCHIVE_DEST WHERE TARGET = 'STANDBY';
$cat stb.sql
prompt
set linesize 140
set pagesize 999
set head off
col name for a18
col database_role for a20
col hd for a8
select
   'DB Name:' hd, name
from
  v$database
union all
select
   'DB Role:' hd,  database_role
from
  v$database
/
set head on
col db_unique_name for a14 head "DB Unique|Name"
col protection_mode for a25 head "Protection|Mode"
col dataguard_broker for a8 head "DG |Broker"
col switchover_status for a20 head "Switchover|Status"
col force_logging for a7 head "Force|Logging"
select
    db_unique_name
  , protection_mode
  , dataguard_broker
  , switchover_status
  , force_logging
from
  v$database
/
col client_process for a14
col process for a7
col thread# for 99 head "T#"
select
    client_process
  , process
  , status
  , thread#
  , sequence#
  , block#
  , blocks
  , delay_mins
from
    v$managed_standby
where
    thread# <> 0
order by
    thread#
  , sequence#
/