Re: Checking lag

From: Ilmar Kerm <ilmar.kerm_at_gmail.com>
Date: Tue, 16 Jul 2024 15:43:10 +0200
Message-ID: <CAKnHwtcW6OXrpee=qa_YYkXH=qV8i9GFTHk-bO8oSHcZeMSjLw_at_mail.gmail.com>



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

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 - 15:43:10 CEST

Original text of this message