View Revisions: Issue #5905

Summary 0005905: Oracle log miner should reset the SCN when it encounters error ORA-01281
Revision 2023-06-29 20:30 by emiller
Description It's possible for the Oracle log miner to repeatedly encounter error ORA-01281, which is shown below. It can recover from this error by resetting the SCN and trying again.

Failed to mine the log StackTraceKey.init [eW:619222589] com.jumpmind.symmetric.console.impl.eW: Failed to init oracle log miner with options=LogMinerOptions [startScn=11594149140, endScn=11601341740, tableNames=[], operations=[DELETE, COMMIT, LOB_TRIM, INSERT, UPDATE, LOB_WRITE, XML DOC END, XML DOC BEGIN, XML DOC WRITE, ROLLBACK], dataSource=org.jumpmind.db.util.ResettableBasicDataSource@2ba32681] Statement: null
    at com.jumpmind.symmetric.console.impl.eU.a(OracleLogMiner.java:381)
    at com.jumpmind.symmetric.console.impl.eU.a(OracleLogMiner.java:105)
    at com.jumpmind.symmetric.console.impl.el.c(TransactionMiner.java:156)
    at com.jumpmind.symmetric.console.service.impl.LogMinerService.mineDataForTables(LogMinerService.java:134)
    at com.jumpmind.symmetric.console.service.impl.LogMinerService.mineData(LogMinerService.java:76)
    at org.jumpmind.symmetric.job.LogMinerJob.doJob(LogMinerJob.java:44)
    at org.jumpmind.symmetric.job.AbstractJob.invoke(AbstractJob.java:202)
    at org.jumpmind.symmetric.job.AbstractJob.run(AbstractJob.java:273)
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
    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-01281: SCN range specified is invalid
ORA-06512: at "SYS.DBMS_LOGMNR", line 82
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.T4CCallableStatement.doOall8(T4CCallableStatement.java:148)
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1048)
    at oracle.jdbc.driver.OracleStatement.executeSQLStatement(OracleStatement.java:1531)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1311)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3746)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3941)
    at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4279)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1010)
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:94)
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:94)
    at com.jumpmind.symmetric.console.impl.eU.j(OracleLogMiner.java:257)
    at com.jumpmind.symmetric.console.impl.eU.i(OracleLogMiner.java:188)
    at com.jumpmind.symmetric.console.impl.eU.a(OracleLogMiner.java:100)
    ... 13 more
Caused by: Error : 1281, Position : 0, Sql = BEGIN dbms_logmnr.add_logfile(logfilename => :1 , options => dbms_logmnr.addfile); END;, OriginalSql = BEGIN dbms_logmnr.add_logfile(logfilename => ?, options => dbms_logmnr.addfile); END;, Error Msg = ORA-01281: SCN range specified is invalid
ORA-06512: at "SYS.DBMS_LOGMNR", line 82
ORA-06512: at line 1

    at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:637)
    ... 31 more
Revision 2023-06-29 20:29 by emiller
Description It's possible for the Oracle log miner to repeatedly encounter error ORA-01281. It can recover from this error by resetting the SCN and trying again.