oracle 连接数被占满的解决方法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u013050593/article/details/73838529

oracle 11g 大量废连接占满数据库连接问题处理

 

问题描述:

数据库不断出现大量无用连接,超过数据库最大连接数,导致新的连接无法建立,访问不通数据库

问题分析:

服务器netstat连接数,大量连接来自办公网连接,不断在增加,通过服务器spid查看数据库对应的sid,查看session会话,点击pl/sql 工具菜单,选择会话,选择所有会话,查看到sid对应的事务是pl/sql.exe为pl/sql客户端连接,关闭所有技术人员的pl/sql客户端,依然不释放连接,原因是技术人员使用pl/sql出现非主动关闭,如网络异常断开,断电等导致关闭客户端连接也不释放

问题处理:

初步使用netstat -anop 命令查session进程对应的pid,kill掉,但是清理之后又有连接不断在增加(办公网网络不好),不能人工不断去清理,解决方案如下1、修改数据库sqlnet配置,oracle 11g 默认在/oracle/product/11.2.0/network/admin/下没有sqlnet.ora文件,从samples复制sqlnet.ora文件到路径下,添加配置SQLNET.EXPIRE_TIME=10,设置无用连接自动清理,间隔为10分钟,自动清理。2、创建job自动定时清理到空闲连接。

如果您觉得我的文章给了您帮助,请为我买一杯饮料吧!以下是我的支付宝,意思一下我将非常感激!

求教服务器tcp连接数占满的问题

02-10

服务端tomcat开始后报错,看了一下错误应该是机器TCP连接数被占满的问题,我的程序中有一个while(true) 的循环每3秒执行InetAddress.getByName(macIP).isReachable(timeOut)执行ping两台客户端。另外两台客户端与服务端各有一个socket长连接。服务端有个ibatis的数据库连接池。rnrn服务端程序运行了几天之后,突然出错,InetAddress.getByName(macIP).isReachable(timeOut)执行时IOException异常了。rnrn重启了tomcat也不管用,只好重启了服务器。rnrn我觉得是InetAddress.getByName(macIP).isReachable(timeOut)的问题,但是我测试了几十万次是没有问题的。服务器系统是win2003server。rnrn请教各位,帮忙分析一下。rnrnrn2011-2-5 9:21:43 org.apache.coyote.http11.Http11BaseProtocol initrn严重: Error initializing endpointrnjava.net.SocketException: No buffer space available (maximum connections reached?): creatern at java.net.ServerSocket.createImpl(ServerSocket.java:255)rn at java.net.ServerSocket.getImpl(ServerSocket.java:205)rn at java.net.ServerSocket.bind(ServerSocket.java:319)rn at java.net.ServerSocket.(ServerSocket.java:185)rn at java.net.ServerSocket.(ServerSocket.java:141)rn at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocketrnrn(DefaultServerSocketFactory.java:50)rn at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:293)rn at org.apache.coyote.http11.Http11BaseProtocol.init(Http11BaseProtocol.java:139)rn at org.apache.catalina.connector.Connector.initialize(Connector.java:1017)rn at org.apache.catalina.core.StandardService.initialize(StandardService.java:578)rn at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:782)rn at org.apache.catalina.startup.Catalina.load(Catalina.java:504)rn at org.apache.catalina.startup.Catalina.load(Catalina.java:524)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:267)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)rn2011-2-5 9:21:43 org.apache.catalina.startup.Catalina loadrn严重: Catalina.startrnLifecycleException: Protocol handler initialization failed: java.net.SocketException: No buffer space available rnrn(maximum connections reached?): creatern at org.apache.catalina.connector.Connector.initialize(Connector.java:1019)rn at org.apache.catalina.core.StandardService.initialize(StandardService.java:578)rn at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:782)rn at org.apache.catalina.startup.Catalina.load(Catalina.java:504)rn at org.apache.catalina.startup.Catalina.load(Catalina.java:524)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:267)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)rn2011-2-5 9:21:43 org.apache.catalina.startup.Catalina loadrn信息: Initialization processed in 1000 msrn2011-2-5 9:21:43 org.apache.catalina.core.StandardService startrn信息: Starting service Catalinarn2011-2-5 9:21:43 org.apache.catalina.core.StandardEngine startrn信息: Starting Servlet Engine: Apache Tomcat/5.5.26rn2011-2-5 9:21:43 org.apache.catalina.core.StandardHost startrn信息: XML validation disabledrn2011-2-5 9:21:45 org.apache.catalina.startup.HostConfig deployWARrn信息: Deploying web application archive HkcSoft2.warrn2011-2-5 9:21:52 org.apache.coyote.http11.Http11BaseProtocol startrn严重: Error starting endpointrnjava.net.SocketException: No buffer space available (maximum connections reached?): creatern at java.net.ServerSocket.createImpl(ServerSocket.java:255)rn at java.net.ServerSocket.getImpl(ServerSocket.java:205)rn at java.net.ServerSocket.bind(ServerSocket.java:319)rn at java.net.ServerSocket.(ServerSocket.java:185)rn at java.net.ServerSocket.(ServerSocket.java:141)rn at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocketrnrn(DefaultServerSocketFactory.java:50)rn at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:293)rn at org.apache.tomcat.util.net.PoolTcpEndpoint.startEndpoint(PoolTcpEndpoint.java:313)rn at org.apache.coyote.http11.Http11BaseProtocol.start(Http11BaseProtocol.java:151)rn at org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:76)rn at org.apache.catalina.connector.Connector.start(Connector.java:1090)rn at org.apache.catalina.core.StandardService.start(StandardService.java:457)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:552)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)rn2011-2-5 9:21:52 org.apache.catalina.startup.Catalina startrn严重: Catalina.start: rnLifecycleException: service.getName(): "Catalina"; Protocol handler start failed: java.net.SocketException: No rnrnbuffer space available (maximum connections reached?): creatern at org.apache.catalina.connector.Connector.start(Connector.java:1097)rn at org.apache.catalina.core.StandardService.start(StandardService.java:457)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:552)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)rn2011-2-5 9:21:52 org.apache.catalina.startup.Catalina startrn信息: Server startup in 8735 msrn2011-2-5 9:21:52 org.apache.catalina.core.StandardServer awaitrn严重: StandardServer.await: create[8005]:

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试

关闭