Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-9409

Oracle Connector does not redirect DML operations when doing logmining on read-only standby database

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • under-triaging
    • 2.5.5.Final
    • oracle-connector
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • Important

      In order to make your issue reports as actionable as possible, please provide the following information, depending on the issue type.

      Bug report

      For bug reports, provide this information, please:

      What Debezium connector do you use and what version?

      Oracle connector, debezium 2.5.5.final, Kafka 3.6.0

      What is the connector configuration?

       

       

      {
        "database.hostname": "10.xxx.xxx.xxx",
        "database.port": "1521",
        "database.user": "${secrets:kafka-connect-PROJECT/oracle-credentials:user}",
        "database.password": "${secrets:kafka-connect-PROJECT/oracle-credentials:password}",
        "database.dbname": "DATABASE_NAME",
        "topic.prefix": "project-test",
        "tasks.max": "2",
        "schema.history.internal.kafka.bootstrap.servers": "broker-1.mskcluster.example.region.amazonaws.com:9096,broker-2.mskcluster.example.region.amazonaws.com:9096,broker-3.mskcluster.example.region.amazonaws.com:9096",
        "schema.history.internal.kafka.topic": "snapshot-schema-changes-project.inventory",
        "schema.history.internal.producer.security.protocol": "SASL_SSL",
        "schema.history.internal.producer.sasl.mechanism": "SCRAM-SHA-512",
        "schema.history.internal.producer.sasl.jaas.config": "${secrets:kafka-connect-PROJECT/sasl-jaas-config:sasl-jaas-config}",
        "schema.history.internal.consumer.security.protocol": "SASL_SSL",
        "schema.history.internal.consumer.sasl.mechanism": "SCRAM-SHA-512",
        "schema.history.internal.consumer.sasl.jaas.config": "${secrets:kafka-connect-PROJECT/sasl-jaas-config:sasl-jaas-config}",
        "decimal.handling.mode": "string",
        "snapshot.max.threads": 3,
        "snapshot.mode": "initial_only",
        "signal.data.collection": "DATABASE_NAME.SCHEMA.DEBEZIUM_SIGNAL",
        "offset.flush.timeout.ms": 60000,
        "offset.flush.interval.ms": 5000,
        "max.request.size": 10485760,
        "log.mining.strategy": "online_catalog",
        "log.mining.sleep.time.max.ms": 1000,
        "log.mining.sleep.time.default.ms": 50,
        "log.mining.sleep.time.increment.ms": 100,
        "log.mining.scn.gap.detection.time.interval.max.ms": 2000,
        "log.mining.scn.gap.detection.gap.size.min": 1000,
        "table.include.list": "SCHEMA.TABLE_NAME",
        "lob.enabled": true,
        "skipped.operations": "t,d",
        "numeric.mapping": "numeric",
        "time.precision.mode": "connect"
      }

       

       

       

      What is the captured database version and mode of deployment?

      (E.g. on-premises, with a specific cloud provider, etc.)

      Oracle 19c, Oracle Database Release 19.28 Patch

      Primary database and Physical standby, both onprem.

      What behavior do you expect?

      We run debezium snapshot on a read-only physical standby database.
      The snapshot to be completed successfully, by redirecting DML operations triggered by log miner to the primary DB.

      What behavior do you see?

      Received the error:

      ORA-16397: statement redirection from Oracle Active Data Guard standby database to primary database failed 

       

       

      Do you see the same behaviour using the latest released Debezium version?

      (Ideally, also verify with latest Alpha/Beta/CR version)

      Unable to use latest release Debezium version, as our kafka (MSK) and strimzi operator does not support it. Upgrading is not an option as we have multiple production systems currently dependent on it.

      Do you have the connector logs, ideally from start till finish?

      (You might be asked later to provide DEBUG/TRACE level log)

      2025-08-29 07:08:27,346 INFO [test-oracle-connector-PROJECT|task-0] Connected metrics set to 'false' (io.debezium.pipeline.ChangeEventSourceCoordinator) [debezium-oracleconnector-PROJECT-test-change-event-source-coordinator] 2025-08-29 07:08:27,832 ERROR [test-oracle-connector-PROJECT|task-0] WorkerSourceTask{id=test-oracle-connector-PROJECT-0} Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted (org.apache.kafka.connect.runtime.WorkerTask) [task-thread-test-oracle-connector-PROJECT-0] org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped.     at io.debezium.pipeline.ErrorHandler.setProducerThrowable(ErrorHandler.java:67)     at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:144)     at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)     at java.base/java.lang.Thread.run(Thread.java:833) Caused by: io.debezium.DebeziumException: java.sql.SQLException: ORA-16397: statement redirection from Oracle Active Data Guard standby database to primary database failed ORA-06512: at "SYS.DBMS_LOCK", line 378 ORA-06512: at "SYS.DBMS_LOCK", line 411 ORA-06512: at "SYS.KUPU$UTILITIES_INT", line 1738 ORA-06512: at "SYS.DBMS_METADATA", line 1216 ORA-06512: at "SYS.DBMS_METADATA", line 8546 ORA-06512: at line 1    at io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:101)     at io.debezium.pipeline.ChangeEventSourceCoordinator.doSnapshot(ChangeEventSourceCoordinator.java:253)     at io.debezium.pipeline.ChangeEventSourceCoordinator.doSnapshot(ChangeEventSourceCoordinator.java:237)     at io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:189)     at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:137)     ... 5 more Caused by: java.sql.SQLException: ORA-16397: statement redirection from Oracle Active Data Guard standby database to primary database failed ORA-06512: at "SYS.DBMS_LOCK", line 378 ORA-06512: at "SYS.DBMS_LOCK", line 411 ORA-06512: at "SYS.KUPU$UTILITIES_INT", line 1738 ORA-06512: at "SYS.DBMS_METADATA", line 1216 ORA-06512: at "SYS.DBMS_METADATA", line 8546 ORA-06512: at line 1    at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:630)     at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:564)     at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1151)     at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:771)     at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:299)     at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:498)     at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:112)     at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1011)     at oracle.jdbc.driver.OracleStatement.executeSQLStatement(OracleStatement.java:1531)     at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1311)     at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:2163)     at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:2118)     at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:328)     at io.debezium.jdbc.JdbcConnection.executeWithoutCommitting(JdbcConnection.java:1451)     at io.debezium.connector.oracle.OracleConnection.getTableMetadataDdl(OracleConnection.java:323)     at io.debezium.connector.oracle.OracleSnapshotChangeEventSource.getCreateTableEvent(OracleSnapshotChangeEventSource.java:244)     at io.debezium.relational.RelationalSnapshotChangeEventSource.createSchemaChangeEventsForTables(RelationalSnapshotChangeEventSource.java:376)     at io.debezium.relational.RelationalSnapshotChangeEventSource.doExecute(RelationalSnapshotChangeEventSource.java:154)     at io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:92)     ... 9 more Caused by: Error : 16397, Position : 0, Sql = begin dbms_metadata.set_transform_param(DBMS_METADATA.SESSION_TRANSFORM, 'DEFAULT'); end;, OriginalSql = begin dbms_metadata.set_transform_param(DBMS_METADATA.SESSION_TRANSFORM, 'DEFAULT'); end;, Error Msg = ORA-16397: statement redirection from Oracle Active Data Guard standby database to primary database failed ORA-06512: at "SYS.DBMS_LOCK", line 378 ORA-06512: at "SYS.DBMS_LOCK", line 411 ORA-06512: at "SYS.KUPU$UTILITIES_INT", line 1738 ORA-06512: at "SYS.DBMS_METADATA", line 1216 ORA-06512: at "SYS.DBMS_METADATA", line 8546 ORA-06512: at line 1    at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:637)     ... 27 more

      What have we tried and verified

      1. DBA already enabled adg_redirect_aml in the DB
      2. DBA tested INSERT operation into standby DB, and it was successfully redirected
      3. Added internal.log.mining.read.only=true

              Unassigned Unassigned
              zyadzarin Zyad Zarin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: