Hi Team,
We use filebeat, logstash, Elasticsearch and kibana for logs. And we have index patterns created and visualisations and then dashboards.
Now I got a requirement saying to display the replication status that is : Transport lag and Apply lag stats between DC Prod Database and DR Prod (Stand by) Database.
PFB queries to fetch log apply gap and transport/apply lag details -
select Name, value from v$dataguard_stats where name in ('transport lag','apply lag');
2.
select sysdate from dual;
select primary.thread#,
primary.maxsequence primaryseq,
standby.maxsequence standbyseq,
primary.maxsequence - standby.maxsequence gap
from ( select thread#, max(sequence#) maxsequence
from v$archived_log
where archived = 'YES'
and resetlogs_change# = ( select d.resetlogs_change# from v$database d )
group by thread# order by thread# ) primary,
( select thread#, max(sequence#) maxsequence
from v$archived_log
where applied = 'YES'
and resetlogs_change# = ( select d.resetlogs_change# from v$database d )
group by thread# order by thread# ) standby
where primary.thread# = standby.thread#;