Oracle - DBZ_SCHEMA_SNAPSHOT never established

40 views
Skip to first unread message

Niklas Berens

unread,
Jun 20, 2022, 6:28:54 AMJun 20
to debezium
Hi there,

I'm having trouble with the Debezium Oracle connector when setting up the initial snapshot on Oracle (19.c SE 2). Currently using the latest 1.9 docker image. Tried with 2.0alpha as well, facing the same issue.

I get the following log output in the final snapshot stage:

---

{"logMessage": "Snapshot - Final stage", "level": "INFO"}
{"logMessage": "Producer failure", "level": "ERROR"}
io.debezium.DebeziumException: java.sql.SQLException: ORA-01086: savepoint 'DBZ_SCHEMA_SNAPSHOT' never established in this session or is invalid      

        at io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:85)
        at io.debezium.pipeline.ChangeEventSourceCoordinator.doSnapshot(ChangeEventSourceCoordinator.java:155)
        at io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:137)
        at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:109)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.sql.SQLException: ORA-01086: savepoint 'DBZ_SCHEMA_SNAPSHOT' never established in this session or is invalid

        at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:494)
        at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:446)
        at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1054)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:623)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:252)
        at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:612)
        at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:213)
        at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:37)
        at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:896)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1119)
        at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1661)
        at oracle.jdbc.driver.OracleStatement.executeLargeUpdate(OracleStatement.java:1626)
        at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1613)
        at oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:282)
        at oracle.jdbc.driver.PhysicalConnection.rollback(PhysicalConnection.java:4002)
        at io.debezium.connector.oracle.OracleSnapshotChangeEventSource.releaseSchemaSnapshotLocks(OracleSnapshotChangeEventSource.java:123)
        at io.debezium.relational.RelationalSnapshotChangeEventSource.doExecute(RelationalSnapshotChangeEventSource.java:122)
        at io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:76)
        ... 8 more
Caused by: Error : 1086, Position : 0, Sql = ROLLBACK TO dbz_schema_snapshot, OriginalSql = ROLLBACK TO dbz_schema_snapshot, Error Msg = ORA-01086: savepoint 'DBZ_SCHEMA_SNAPSHOT' never established in this session or is invalid

        at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:498)
        ... 25 more

---


It says it cannot rollback to the dbz_schema_snapshot savepoint and thus fails.
However, I wonder if this rollback is expected behaviour or if the reason for the rollback is the real cause for the connector to stop. Note the "producer failure" error just above the exception.

I tried starting the connector with Debug log level, but gained no further insights.

Anyhow, I noticed that this error appears to be flaky. Once the schema change topic (which equals the logical server name) has been created by sending first messages, the connector has no problems coming up and performing the snapshot. When I reset the connector by deleting all topics, I keep getting this error until the schema change topic has been created by sending messages to it. For me, this looks like a race condition, as I cannot gain any further insights from the logs.

Is this a known issue? Any ideas on how to fix it?

Best regards and thanks,
Niklas

Chris Cranford

unread,
Jun 21, 2022, 8:27:24 AMJun 21
to debe...@googlegroups.com, Niklas Berens
Hi Niklas -

So what this sounds like to me is that the connector never got to the point to create the save-point, hence the error.  Would you be willing to send me the full connector logs when you start a new connector without the history topic created, with TRACE enabled so I could take a closer look?

Thanks,
CC
--
You received this message because you are subscribed to the Google Groups "debezium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debezium+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/debezium/94186804-5c51-4572-bb2a-2277f8a5e002n%40googlegroups.com.

Chris Cranford

unread,
Jun 23, 2022, 12:39:31 PMJun 23
to debe...@googlegroups.com, Niklas Berens
HI Niklas -

Would you be willing to add the full connector logs to https://issues.redhat.com/browse/DBZ-5281?
I'd like to better understand how you reached this error and if we can avoid it.

Thanks,
Chris
Reply all
Reply to author
Forward
0 new messages