Details
-
Bug
-
Resolution: Done
-
Major
-
1.5.0.Beta2
-
None
-
False
-
False
-
Undefined
Description
The connector performs a sanity check at the start of the streaming phase where it fetches the minimum SCN available in both the V$LOG and V$ARCHIVED_LOG tables. The portion of the query that relates to V$ARCHIVED_LOG should be predicated to return the minimum value where STATUS='A' as deleted, unavailable, or expired logs will yield a missing logfile exception and require a re-snapshot.
The query in SqlUtils should read
static String oldestFirstChangeQuery(Duration archiveLogRetention) { if (!archiveLogRetention.isNegative() && !archiveLogRetention.isZero()) { return String.format("SELECT MIN(FIRST_CHANGE#) FROM (SELECT MIN(FIRST_CHANGE#) AS FIRST_CHANGE# FROM %s " + "UNION SELECT MIN(FIRST_CHANGE#) AS FIRST_CHANGE# FROM %s " + "WHERE FIRST_TIME >= SYSDATE - (%d/24) AND STATUS='A')", LOG_VIEW, ARCHIVED_LOG_VIEW, archiveLogRetention.toHours()); } return String.format("SELECT MIN(FIRST_CHANGE#) FROM (SELECT MIN(FIRST_CHANGE#) AS FIRST_CHANGE# FROM %s " + "UNION SELECT MIN(FIRST_CHANGE#) AS FIRST_CHANGE# FROM %s WHERE STATUS='A')", LOG_VIEW, ARCHIVED_LOG_VIEW); }