(plugin) database::oracle - mode dataguard use dataguard_stats view first for lag time (#3476)

This commit is contained in:
qgarnier 2022-02-09 11:58:55 +01:00 committed by GitHub
parent 5558adc5a4
commit 75b52633ba
1 changed files with 14 additions and 0 deletions

View File

@ -158,6 +158,20 @@ sub manage_selection {
}
);
@result = $options{sql}->fetchrow_array();
if (!defined($result[0]) || $result[0] eq '') {
$options{sql}->query(
query => q{
SELECT
CEIL((SYSDATE - MAX(first_time)) * 24 * 60)
FROM
v$archived_log
WHERE
applied NOT IN ('NO') AND registrar = 'RFS'
}
);
@result = $options{sql}->fetchrow_array();
}
$self->{global}->{lag_minutes} = defined($result[0]) && $result[0] ne '' ? $result[0] : -1;
$options{sql}->disconnect();