Gooora 发表于 2014-2-19 11:06:45

应用里提示连接数据库超时

系统环境:RHEL6u4 x86_64
数据库:ORACLE 11gR2 112030
问题描述:alter log里有大量的如下信息
数据库和应用之间有checkpoint防火墙
***********************************************************************


Fatal NI connect error 12170.

  VERSION INFORMATION:
        TNS for Linux: Version 11.2.0.3.0 - Production
        Oracle Bequeath NT Protocol Adapter for Linux: Version 11.2.0.3.0 - Production
        TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.3.0 - Production
  Time: 19-FEB-2014 02:58:45
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12535

TNS-12535: TNS:operation timed out
    ns secondary err code: 12560
    nt main err code: 505

TNS-00505: Operation timed out
    nt secondary err code: 110
    nt OS err code: 0


***********************************************************************
tomcat 应用里提示连接数据库超时(数据库是可以连接的)
## Cause: java.sql.SQLRecoverableException: IO Error: Connection timed out
; SQL []; IO Error: Connection timed out; nested exception is java.sql.SQLRecoverableException: IO Error: Connection timed out
        at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:257)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
        at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
        at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:368)
        at com.sun.proxy.$Proxy8.selectList(Unknown Source)
        at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:198)
        at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:114)
        at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:58)
        at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:43)
        at com.sun.proxy.$Proxy13.selectBylotteryId(Unknown Source)
        at com.ecp888.digitapp.service.lottery.impl.SaleInfoServiceImpl.getSalecontrol(SaleInfoServiceImpl.java:187)
        at com.ecp888.digitapp.service.lottery.impl.SaleInfoServiceImpl.getLotterySaleInfo(SaleInfoServiceImpl.java:83)
        at com.ecp888.digitapp.service.lottery.impl.SaleInfoServiceImpl$$FastClassByCGLIB$$8d14aeef.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:124)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:51)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:51)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631)
        at com.ecp888.digitapp.service.lottery.impl.SaleInfoServiceImpl$$EnhancerByCGLIB$$5fed85bf.getLotterySaleInfo(<generated>)
        at com.ecp888.web.action.hfreq.SaleinfoAction.getLotterySaleInfo(SaleinfoAction.java:58)
        at sun.reflect.GeneratedMethodAccessor100.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)

Maclean Liu(刘相兵 发表于 2014-2-19 11:18:40

1、你具体想问什么?

2、 tomcat 报错只看到超时, 从ORA角度 可以做的是 搞一些例如sql net trace去了解 它耗时在哪里
页: [1]
查看完整版本: 应用里提示连接数据库超时