{"record":{"id":"993b7a3e4adac012","repo":"apache/seatunnel","slug":"online-redo-log-files-or-archive-log-files-do-not","errorCode":null,"errorMessage":"Online REDO LOG files or archive log files do not contain the offset scn <startScn>.  Please perform a new snapshot.","messagePattern":"Online REDO LOG files or archive log files do not contain the offset scn <startScn>\\.  Please perform a new snapshot\\.","errorType":"exception","errorClass":"DebeziumException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-oracle/src/main/java/io/debezium/connector/oracle/logminer/LogMinerStreamingChangeEventSource.java","lineNumber":171,"sourceCode":"            jdbcConnection.setAutoCommit(false);\n\n            startScn = offsetContext.getScn();\n            snapshotScn = offsetContext.getSnapshotScn();\n            Scn firstScn = getFirstScnInLogs(jdbcConnection);\n            if (startScn.compareTo(snapshotScn) == 0) {\n                // This is the initial run of the streaming change event source.\n                // We need to compute the correct start offset for mining. That is not the snapshot\n                // offset,\n                // but the start offset of the oldest transaction that was still pending when the\n                // snapshot\n                // was taken.\n                computeStartScnForFirstMiningSession(offsetContext, firstScn);\n            }\n\n            try (LogWriterFlushStrategy flushStrategy = resolveFlushStrategy()) {\n                if (!isContinuousMining && startScn.compareTo(firstScn.subtract(Scn.ONE)) < 0) {\n                    // startScn is the exclusive lower bound, so must be >= (firstScn - 1)\n                    throw new DebeziumException(\n                            \"Online REDO LOG files or archive log files do not contain the offset scn \"\n                                    + startScn\n                                    + \".  Please perform a new snapshot.\");\n                }\n\n                setNlsSessionParameters(jdbcConnection);\n                checkDatabaseAndTableState(jdbcConnection, connectorConfig.getPdbName(), schema);\n\n                try (LogMinerEventProcessor processor =\n                        createProcessor(context, partition, offsetContext)) {\n\n                    if (archiveLogOnlyMode && !waitForStartScnInArchiveLogs(context, startScn)) {\n                        return;\n                    }\n\n                    initializeRedoLogsForMining(jdbcConnection, false, startScn);\n\n                    int retryAttempts = 1;","sourceCodeStart":153,"sourceCodeEnd":189,"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#L153-L189","documentation":"When starting streaming, LogMinerStreamingChangeEventSource.execute computes the first available SCN from the online redo/archive logs and validates that the offset SCN (startScn, the exclusive lower bound) is not older than firstScn - 1. If the offset SCN has aged out of the retained logs, mining cannot start from it, so Debezium fails with this exception demanding a new snapshot (in continuous mining mode this check is skipped).","triggerScenarios":"execute -> computeStartScnForFirstMiningSession obtains firstScn from the oldest available log; the stored offset startScn < firstScn - 1 because logs were switched/archived/purged while the connector was stopped or lagging, and isContinuousMining is false.","commonSituations":"Connector offline longer than redo log retention; aggressive archivelog deletion by RMAN/DBA scripts; long snapshot duration letting logs rotate past the captured SCN; restarting an old saved offset after DB maintenance.","solutions":["Perform a new snapshot so the offset SCN is within the available redo/archive window","Increase redo log size/count and archive log retention so the connector can tolerate restarts/lag","Enable (or rely on) continuous_mining behavior where supported to relax the boundary check after evaluating consistency implications","Resume streaming promptly after outages; monitor the gap between current SCN and offset SCN and alert before logs age out"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"-- Before restarting streaming, verify offset SCN is still minable:\n-- offsetScn from connector offsets, then:\nSELECT MIN(FIRST_CHANGE#) FROM V$ARCHIVED_LOG WHERE DELETED='NO';\n-- if offsetScn < that value (minus 1), plan a new snapshot instead of restarting","typeGuard":null,"tryCatchPattern":"try {\n    source.execute(context);\n} catch (DebeziumException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"do not contain the offset scn\")) {\n        // offset SCN aged out of redo/archive logs: full re-snapshot required\n        planner.recoverWithSnapshot();\n    } else { throw e; }\n}","preventionTips":["Size redo logs and archive retention for worst-case connector downtime","Alert when (current SCN - offset SCN) approaches the oldest retained log SCN","Resume streaming quickly after outages; avoid long-stopped offsets","Use incremental snapshot to shorten windows where offsets can age out"],"tags":["cdc","oracle","logminer","scn","redo-log","snapshot-required"],"backgroundTag":"scn-outside-redo-log-window","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"}