我正在運行批處理應用程序,該應用程序處理大量數據文件並將數據存入Oracle 11g數據庫。我正在使用Java 1.6.20,ojdbc6和ucp11.2。間歇性地,我得到ORA-01010無效操作SQLExceptions。當我擡頭一看這個錯誤的意思,並採取它的行動:OCI無效操作ORA-01010
ORA-01010: invalid OCI operation
Cause:
One of the following: 1) You attempted an invalid OCI operation. 2) You are using an Oracle client application linked with version 7.1 (or higher) libraries, the environment variable ORA_ENCRYPT_LOGIN is set to TRUE, and you attempted to connect to a version 7.0 (or lower) Oracle Server. 3) You are connected to a version 7.1 (or higher) Oracle Server, the initialization parameter DBLINK_ENCRYPT_LOGIN is set to TRUE, and you attempted to use a database link pointing to a version 7.0 (or lower) Oracle Server. 4) You are connected to a version 9.0.2(or higher) Oracle Server and you attempted to use a database link pointing to a version 9.0.1(or lower) Oracle Server for distributed autonomous transaction.
Action:
For the above causes: 1) Do not use the invalid OCI operation. 2) If you do not wish to use encrypted connect passwords in your distributed database, set ORA_ENCRYPT_LOGIN to FALSE. If you wish to use encrypted connect passwords, you must upgrade all Oracle Servers to version 7.1 (or higher). 3) If you do not wish to use encrypted database links in your distributed database, set DBLINK_ENCRYPT_LOGIN to FALSE. If you wish to use encrypted database links, you must upgrade all Oracle Servers to version 7.1 (or higher). 4) Do not attempt distributed autonomous transaction on version 9.0.1(or lower) Oracle Server.
這是沒有意義的我,因爲我使用的是較新的JDBC驅動程序和一個漂亮的當前版本的Oracle。如果問題是登錄,爲什麼它會工作大約90-95%而不是其他5-10%?我確保所有的Oracle服務器都是11g。我還提出了ORA-01010信息,以便任何試圖回答此問題的人都可以避免這樣做,並認爲他們找到了答案。除非你能解釋這個似乎與我的問題沒有多大關係的看似神祕的信息,否則不要打擾。
更新基於以下意見:
這裏是確切的錯誤:
Exception in thread "main" org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [select sum(FREQ) from CONTRIBUTOR_DETL where EXTRACT(MONTH FROM DOS) BETWEEN 6 and 8 and CONTRIBUTOR_HDR_ID = ? and ERROR_FOUND = 'N']; SQL state [72000]; error code [1010]; ORA-01010: invalid OCI operation
; nested exception is java.sql.SQLException: ORA-01010: invalid OCI operation
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:602)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:636)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:665)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:673)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:728)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:744)
at org.springframework.jdbc.core.JdbcTemplate.queryForInt(JdbcTemplate.java:775)
at org.ddpa.dsc.dao.impl.DscSummaryDaoImpl.getAcceptedOccurrencesBySummerQuarter(DscSummaryDaoImpl.java:176)
at org.ddpa.dsc.reports.DscSummaryReport.getSummaryReport(DscSummaryReport.java:132)
at org.ddpa.dsc.pre.DscPreprocessor.preprocessFile(DscPreprocessor.java:195)
at org.ddpa.dsc.Main.main(Main.java:33)
Caused by: java.sql.SQLException: ORA-01010: invalid OCI operation
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3431)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1491)
at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.ucp.jdbc.proxy.PreparedStatementProxyFactory.invoke(PreparedStatementProxyFactory.java:110)
at $Proxy3.executeQuery(Unknown Source)
at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:643)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586)
這是你得到的唯一錯誤嗎?我也希望看到ora-3137,這是違反協議的行爲。你能發佈完整的錯誤文本嗎?有可能網絡數據包在線路上損壞。有時候,當數據包太短時會引發此錯誤。 – steve
這是你得到的唯一錯誤嗎?我也希望看到ora-3137,這是違反協議的行爲。你能發佈完整的錯誤文本嗎?有可能網絡數據包在線路上損壞。有時候,當數據包太短時會引發此錯誤。 – steve
不幸的是,這就是我從堆棧跟蹤中獲得的所有信息。它是隨機發生的,它似乎沒有與它試圖打印的報告的大小以及這兩個環境的大小有關,我已經測試了這個代碼,這是似乎有問題的那個。 – JavaDev03