{"record":{"id":"2b2f368013d0ae8d","repo":"apache/seatunnel","slug":"cannot-get-maximum-archive-log-scn-as-no-archive-l","errorCode":null,"errorMessage":"Cannot get maximum archive log SCN as no archive logs are present.","messagePattern":"Cannot get maximum archive log SCN as no archive logs are present\\.","errorType":"exception","errorClass":"DebeziumException","httpStatus":null,"severity":"critical","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-oracle/src/main/java/io/debezium/connector/oracle/logminer/LogMinerStreamingChangeEventSource.java","lineNumber":484,"sourceCode":"     *\n     * @param logFiles the current logs that are part of the mining session\n     * @return the maximum system change number from the archive logs\n     * @throws DebeziumException if no logs are provided or if the provided logs has no archive log\n     *     types\n     */\n    private Scn getMaxArchiveLogScn(List<LogFile> logFiles) {\n        if (logFiles == null || logFiles.isEmpty()) {\n            throw new DebeziumException(\n                    \"Cannot get maximum archive log SCN as no logs were available.\");\n        }\n\n        final List<LogFile> archiveLogs =\n                logFiles.stream()\n                        .filter(log -> log.getType().equals(LogFile.Type.ARCHIVE))\n                        .collect(Collectors.toList());\n\n        if (archiveLogs.isEmpty()) {\n            throw new DebeziumException(\n                    \"Cannot get maximum archive log SCN as no archive logs are present.\");\n        }\n\n        Scn maxScn = archiveLogs.get(0).getNextScn();\n        for (int i = 1; i < archiveLogs.size(); ++i) {\n            Scn nextScn = archiveLogs.get(i).getNextScn();\n            if (nextScn.compareTo(maxScn) > 0) {\n                maxScn = nextScn;\n            }\n        }\n\n        LOGGER.debug(\"Maximum archive log SCN resolved as {}\", maxScn);\n        return maxScn;\n    }\n\n    /**\n     * Requests Oracle to build the data dictionary.\n     *","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-oracle/src/main/java/io/debezium/connector/oracle/logminer/LogMinerStreamingChangeEventSource.java#L466-L502","documentation":" getMaxArchiveLogScn filters the discovered log files to those of type ARCHIVE and throws when none remain. Unlike the empty-list case, logs were found but all are ONLINE/redo logs — the connector cannot compute a maximum archived-log SCN. This typically happens when the required SCN range is no longer covered by archived logs.","triggerScenarios":"currentScn calls getMaxArchiveLogScn with a non-empty logFiles list, but the filter log.getType().equals(LogFile.Type.ARCHIVE) removes every entry, leaving archiveLogs empty — e.g. only online redo logs present for the queried window.","commonSituations":"Frequent log switches with slow archiving so current redo hasn't been archived; recent NOARCHIVELOG period creating a gap; short archiveLogRetention excluding recent archives; startup immediately after a database restart before any switch.","solutions":["Force an archive log switch: ALTER SYSTEM SWITCH LOGFILE; wait for archiving, then restart the connector.","Increase archiveLogRetention so recent archived logs fall within the discovery query window.","Check that the archiver process is running (V$ARCHIVE_PROCESSES status should be STARTED/ACTIVE).","If the offset SCN falls in an unarchived gap, take a new snapshot and restart from the fresh SCN."],"exampleFix":"null","handlingStrategy":"retry","validationCode":"-- ensure archived (not just online) logs cover the needed window\nSELECT COUNT(*) FROM V$ARCHIVED_LOG\n WHERE FIRST_CHANGE# <= :offsetScn AND NEXT_CHANGE# > :offsetScn;","typeGuard":null,"tryCatchPattern":"try {\n    startConnector();\n} catch (DebeziumException e) {\n    if (e.getMessage().contains(\"no archive logs are present\")) {\n        // wait for a log switch, then retry\n        Thread.sleep(60_000);\n        startConnector();\n    } else { throw e; }\n}","preventionTips":["Force periodic log switches so redo is archived promptly","Keep archiveLogRetention large enough to cover connector downtime","Verify ARCHIVE process is running (V$ARCHIVE_PROCESSES)"],"tags":["oracle","cdc","logminer","archived-log","scn"],"backgroundTag":"empty-result-set","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}