ORA-16331: container is not open ORA-06512: at “SYS.DBMS_LOGMNR“
使用Flink CDC、Debezium等CDC工具对Oracle进行基于log的实时数据同步时遇到异常ORA-16331: container is not open的解决方案。
1. 异常信息
异常信息通常如下:
at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1823)
at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1778)
at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:303)
at io.debezium.jdbc.JdbcConnection.executeWithoutCommitting(JdbcConnection.java:1446)
at io.debezium.connector.oracle.logminer.LogMinerStreamingChangeEventSource.startMiningSession(LogMinerStreamingChangeEventSource.java:678)
at io.debezium.connector.oracle.logminer.LogMinerStreamingChangeEventSource.execute(LogMinerStreamingChangeEventSource.java:245)
... 9 more
Caused by: Error : 16331, Position : 0, Sql = BEGIN sys.dbms_logmnr.start_logmnr(startScn => '12248380118', endScn => '12348400117', OPTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG + DBMS_LOGMNR.NO_ROWID_IN_STMT);END;, OriginalSql = BEGIN sys.dbms_logmnr.start_logmnr(startScn => '12248380118', endScn => '12348400117', OPTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG + DBMS_LOGMNR.NO_ROWID_IN_STMT);END;, Error Msg = ORA-16331: container "ORACLE_TEST” is not open
ORA-06512: at "SYS.DBMS_LOGMNR", line 72
ORA-06512: at line 1
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:513)
... 24 more
2. 解决方案
关键异常信息是,ORA-16331: container "ORACLE_TEST” is not open。
让DBA开启container ORACLE_TEST(替换为实际的container),然后重启CDC任务就可以修复了。