java.sql.SQLException: Listener refused the connection with the following error:

java.sql.SQLException: Listener refused the connection with the following error: 
 ORA-12519, TNS:no appropriate service handler found 
 The Connection descriptor used by the client was: 
 192.168.1.209:1521:RUNMONIT 
  
 	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) 
 	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261) 
 	at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387) 
 	at oracle.jdbc.driver.PhysicalConnection. <init>(PhysicalConnection.java:414) 
 	at oracle.jdbc.driver.T4CConnection. <init>(T4CConnection.java:165) 
 	at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35) 
 	at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801) 
 	at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134) 
 	at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182) 
 	at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171) 
 	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137) 
 	at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014) 
 	at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32) 
 	at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810) 
 	at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRun



解决办法:

检查数据库方面是否超过了数据库允许的连接数,为什么用的不是连接池/?、?


select count(*) from v$process --当前的连接数
select value from v$parameter where name = 'processes' --数据库允许的最大连接数

修改最大连接数:
alter system set processes = 300 scope = spfile;

创建pfile
SQL>create pfile from spfile;
注:如果不做此步,可能会导致更改最大连接数之后数据库不能启动现象

重启数据库:
shutdown immediate;
startup;

--查看当前有哪些用户正在使用数据
SELECT osuser, a.username,cpu_time/executions/1000000||'s', sql_fulltext,machine
from v$session a, v$sqlarea b
where a.sql_address =b.address order by cpu_time/executions desc;

原文出自:http://topic.csdn.net/u/20110406/14/7ce6c646-bef3-4859-a35e-90ae61c20b67.html

参考:http://blog.csdn.net/lele2426/article/details/4978283

你可能感兴趣的:(SQLException)