Custom Metric - Oracle Standby Database Log Apply Drift Metric

This custom metric will collect data every 10 minutes and plot the delta between redo logs archived on the primary instance and logs applied on the standby instance.

METRIC DEFINITION

To create the custom metric, click on Options > Custom Resource Metrics and configure the metric similar to this:

Database Type: Oracle

Database Versions: <no limitations>

Display Name: Log Apply Drift

Description: <add your own description>

Category: <add to whatevfer category you like or create a new one>

Units: Sequence Diff

Metric Type: Single Value

Frequency: 600

Timeout: 50

SQL Statement:

select (

SELECT MAX(SEQUENCE#) LOG_ARCHIVED

FROM V$ARCHIVED_LOG

WHERE DEST_ID=1

AND ARCHIVED='YES'

) - (

SELECT MAX(SEQUENCE#) LOG_APPLIED

FROM V$ARCHIVED_LOG

WHERE DEST_ID=2

AND APPLIED='YES'

) from dual;