Re: Checking lag

From: yudhi s <learnerdatabase99_at_gmail.com>
Date: Wed, 17 Jul 2024 01:28:23 +0530
Message-ID: <CAEzWdqdNbUfcqcByJUFXAudUjapbmVxibgLkugFcqJRGG5H-XA_at_mail.gmail.com>



Thank you so much. This helps.

On Tue, Jul 16, 2024 at 7:14 PM Ilmar Kerm <ilmar.kerm_at_gmail.com> wrote:

> If by "DR database" you mean Data Guard physical standby and you want to
> query it from the standby side, then:
>
> WITH
> FUNCTION interval_to_seconds(p_int interval day to second) RETURN
> number
> DETERMINISTIC
> IS
> BEGIN
> -- Converts interval to seconds
> RETURN
> extract(day from p_int)*86400+
> extract(hour from p_int)*3600+
> extract(minute from p_int)*60+
> extract(second from p_int);
> END;
> SELECT name, interval_to_seconds(to_dsinterval(value)) lag_s
> FROM v$dataguard_stats
> WHERE name IN ('transport lag','apply lag')
>
> There are other options also:
>
> https://ilmarkerm.eu/blog/2023/03/monitoring-data-guard-fast-start-failover-setup/
>
>
> On Tue, 16 Jul 2024 at 15:29, yudhi s <learnerdatabase99_at_gmail.com> wrote:
>
>> Hi All,
>>
>> It's oracle version 19.21. Is there possible way to get the lag between the
>> primary and DR database in duration with units as seconds/minutes/hours?
>>
>> All i find is the data dictionary views like
>> v$database,v$standby_log,v$archived_log,v$dataguard_stats tec. But not able
>> to make these query such a way that it will give the results in unit as
>> "seconds" of lag.
>>
>> The requirement is to use this query in one of the application which will
>> be running it in certain interval before querying data, to ensure the lag
>> is minimal otherwise take some action accordingly on the data fetch queries
>> from teh DR database.
>>
>>
>> Regards
>>
>> Yudhi
>>
>
>
> --
> Ilmar Kerm
>

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jul 16 2024 - 21:58:23 CEST

Original text of this message