[Solved] Connections could not be acquired from the underlying database!

Connections could not be acquired from the underlying database! // Unable to connect to the currently configured database tns-12541: TNS: no listener// no listener tns-12560: TNS: protocol adapter error// protocol adapter error tns-00511: no listener// no listener

Foreword:
in the development environment, the project runs normally, the sudden landing page can be displayed, and the landing operation is abnormal
query background log, error description:

Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
	at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529)
	at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
	at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:56)
	at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
	... 148 more
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
	at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319)
	at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)
	at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
	... 151 more  

Some time ago, the project was running normally, but there was a problem this afternoon, which indicates that the program configuration is normal, and it is also normal to check the number of database connections. This problem can only occur in the database

Use the database connection tool to connect, find the monitoring problem, TNS view the monitoring situation

lsnrctl status

The questions are as follows:

LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 07-Dec-2018 18:22:47

Copyright (c) 1991, 2007, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
TNS-12541: TNS:no listener  
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=GCRM0CV1)(PORT=1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused

The problem may be that there is a problem with the listening configuration file, but the listening configuration file has not been adjusted during this period of time. After checking the listening configuration file, there is no problem. Continue to investigate

Stop listening

lsnrctl stop

The problem is the same as described above

Start monitoring

lsnrctl start  

The questions are as follows:

LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 07-11月-2018 18:23:22

Copyright (c) 1991, 2007, Oracle.  All rights reserved.

Starting /home/db/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.4.0 - Production
NL-00280: error creating log stream /home/db/oracle/product/10.2.0/db_1/network/log/listener.log
 NL-00278: cannot open log file
  SNL-00016: snlfohd: error opening file
   Linux Error: 13: Permission denied

Listener failed to start. See the error message(s) above...

View log:

ls -lh /home/db/oracle/product/10.2.0/db_1/network/log/listener.log 

It is found that the log size is larger than 4G, and the problem is found. This is the Oracle bug. When the listner log grows to 4GB, it is very slow to connect through the listener

Solution:

1. lsnrctl enters interactive mode  
2. execute set current_listener LISTENER  
3. set log_status off  
4. stop stop the listener  
5. manually delete the listener.log file under the specified listener log path  
6. start start the listener  
7. status Check the status

Similar Posts: