RE: Dataguard Monitoring

From: Flora Deng <hdeng_at_northwestern.edu>
Date: Wed, 6 Oct 2010 09:24:43 -0500
Message-ID: <023f01cb6562$3859f110$a90dd330$_at_edu>



If you're using real time apply and just want to check if DG is out of sync, here is a quick SQL:
Suppose 'dest_id=2' is your standby and any rows returned will mean standby is out of sync.

select thread#,max(sequence#) from v\$archived_log

   where dest_id=2 and applied='YES'
   group by thread#
minus
 select thread#,max(sequence#) from v\$archived_log    where dest_id=2 and archived='YES'
   group by thread#;

Flora

-----Original Message-----
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Mir M. Mirhashimali
Sent: Tuesday, October 05, 2010 11:46 AM To: howard.latham_at_gmail.com
Cc: oracle-l_at_freelists.org
Subject: Re: Dataguard Monitoring

we use ZABBIX to monitor our database with custom scripts. when the lag is 15 mins or more i get a SMS and email.

data-guard.sh



#!/bin/sh
. /home/oracle/.profile_db01
cd /home/oracle/zabbix
sqlplus -s /nolog _at_check_log.sql

check_log.sql



connect / as sysdba

set pagesize 0;
set heading off;
set feedback off
set trimspool on;

select to_char(max(next_time), 'rrrr-mm-dd-hh24:mi:ss') next_time

   from v$archived_log
  where upper(applied) = 'YES'
    and registrar = 'RFS';

exit;

--
Hope this Helps
Mir


On 10/5/2010 8:09 AM, Howard Latham wrote:

> Anyone point me in the right direction for an 11g Linux Script to
> monitor Dataguard lag?
>
> I have googled and looked on oracle Support.
>
> --
> Howard A. Latham
>
> Sent from my Nokia N97
>
> !DSPAM:2052,4cab240948768356213163!
-- http://www.freelists.org/webpage/oracle-l -- http://www.freelists.org/webpage/oracle-l
Received on Wed Oct 06 2010 - 09:24:43 CDT

Original text of this message