问题现象
系统突然间登录报如下错误:SELECT * FROM sm_user WHERE user_code_q=? 无法从套接字读取更多的数据
问题分析
查看nc-log.log发现大量相关报错
$$callid=1723104097968-1063 $$thread=[http-bio-xxx-xxx-exec-xxx] $$host=xxx$$userid=#UAP# $$ts=xxx-08-08 16:01:37 $$remotecall=[nc.login.bs.INCLoginService] $$debuglevel=ERROR $$msg=<SELECT * FROM sm_user WHERE user_code_q = null>throws 无法从套接字读取更多的数据
$$callid=1723104097968-1063 $$thread=[http-bio-xxx-xxx-exec-xxx] $$host=xxx $$userid=#UAP# $$ts=xxx-08-08 16:01:37 $$remotecall=[nc.login.bs.INCLoginService] $$debuglevel=ERROR $$msg=sql original exception
java.sql.SQLException: 无法从套接字读取更多的数据
at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1142)
at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1099)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:288)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:863)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1153)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1275)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3620)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1203)
at uap.mw.ds.UAPPreparedStatement.executeQuery(UAPPreparedStatement.java:73)
at nc.jdbc.framework.crossdb.CrossDBPreparedStatement.executeQuery(CrossDBPreparedStatement.java:103)
at nc.jdbc.framework.JdbcSession.executeQuery(JdbcSession.java:297)
at nc.jdbc.framework.JdbcPersistenceManager.retrieveByClause(JdbcPersistenceManager.java:955)
at nc.bs.dao.BaseDAO.retrieveByClause(BaseDAO.java:280)
at nc.bs.dao.BaseDAO.retrieveByClause(BaseDAO.java:230)
at nc.vo.uap.rbac.util.RbacUserPwdUtil.getUserActualCodecPwd(RbacUserPwdUtil.java:140)
at nc.vo.uap.rbac.util.RbacUserPwdUtil.checkUserPassword(RbacUserPwdUtil.java:87)
at nc.identityverify.pub.StaticPWDVerifier.verify(StaticPWDVerifier.java:14)
at nc.identityverify.bs.impl.IdentityVerifyEngine.identityVerify(IdentityVerifyEngine.java:97)
at nc.identityverify.bs.impl.IdentityVerifyImpl.identityVerify(IdentityVerifyImpl.java:63)
at nc.login.bs.LoginVerifyBean.identityVerify(LoginVerifyBean.java:167)
at nc.login.bs.impl.LoginEngine.verify(LoginEngine.java:148)
at nc.login.bs.impl.LoginEngine.login(LoginEngine.java:173)
at nc.login.bs.impl.NCLoginImplement.login(NCLoginImplement.java:71)
at sun.reflect.GeneratedMethodAccessor4275.invoke(Unknown Source)
... ...
于是排除数据库alert日志
发现数据库有ORA-07445报错
ORA-07445传说中是因为Oracle的bug所导致的。而当oracle服务器进程从操作系统收到一个致命的错误信息时会抛出ora-07445错误,这个错误可以被oracle后台进程或者用户进程激发。当错误被抛出时,系统会首先写一个错误日志到alert.log文件中,然后会写跟踪文件到user_dump_dest或background_dump_dest中;最后会将主存信息转储到core_dump_dest中。
解决方案
1、修改相关_optimizer_connect_by_cost_based参数
--- 需要重启数据库
alter system set “_optimizer_connect_by_cost_based” = false scope=both;
---对当前session生效
alter session set “_optimizer_connect_by_cost_based” = false scope=both;
2、修改相关query_rewrite_enabled参数
--- 需要重启数据库
alter system set query_rewrite_enabled=false scope=both;
---对当前session生效
alter session set query_rewrite_enabled=false scope=both ;