Monday, September 23, 2013

Could not create connection; - nested throwable: java.sql.SQLException: Listener refused the connection with the

Last week after applying april PSU  our application was getting below error,

  2013-09-19 00:05:14"ERROR [STDERR] org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: java.sql.SQLException: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor"
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:419)
            at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:536)
            at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:228)
            at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
            at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
            at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory
===================================

at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1275)
  at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576)
  at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3677)
 - locked <0xde1c0518> (a oracle.jdbc.driver.T4CConnection)
  at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1086) 
Below is finding -
After SCAN VIP and SCAN listener failover, instance does not register with the SCAN listener. It might happen for only 1 of the scan listener. Client connection gets intermittent ORA-12514 TNS:listener does not currently know of service requested in connect descriptor.
Solution:

1) For both above bugs, the workaround is to unregister and register remote listener on the database instance which does not register to a SCAN listener with following steps.
show parameter remote_listener
alter system set remote_listener='';
alter system register;
alter system set remote_listener='<scan>:<port>';
alter system register;
 
2 - As a workaround  relocate scan  listener from one node to another node this also  resolve my issue .

3) Other points to check if service is not registered with SCAN listener:
a. remote_listener and local_listener is defined correctly
b. EZCONNECT is defined in sqlnet.ora, eg: NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
c. SCAN name is defined in /etc/hosts or DNS and whether there is any mismatch if it is defined in both places
d. nslookup <scan> should display SCAN VIP in round-robin fashion
e. do not set SECURE_REGITER_<listener> in listener.ora if the class of secure transports (COST) is not configured.

1 comment:

  1. Thank's a lot ,This approach solve my issue also ..

    ReplyDelete