Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Cannot connect to Oracle Service Name only SID

SA-8524

Summary



Unable to connect to an external database using service name.

Error Messages



Caused by: java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor


Steps to Reproduce

  1. Have a valid configuration to connect to a SID
  2. Replace SID name with a service name and recycle.

Root Cause



The root cause of this problem is in a third-party product.

Resolution



This is an issue with the Oracle TNS listener most likely. In order to help isolate the problem, perform the following change to the operating environment: 
  1. Execute the  "lsnrctl status" command from the oracle server.
  2. Use any database client tool on the same machine that runs PRPC and connect using the URL that you have provided.
The above mentioned steps allow the configuration actions to know whether the TNS listener is configured properly.
 

The explanation for this behavior is as follows:

As an example configure the tnsnames.ora file to have an entry similar to the following data:

ORCL =
(DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP)(HOST = sever.pega.com)(PORT = 1521))
      (CONNECT_DATA =
       (SERVER = DEDICATED)
       (SERVICE_NAME = orcl.pega.com)
   )
)


The connection url should look like this
url="jdbc:Oracle:thin:@//sever.pega.com:1521/orcl.pega.com"
Suggest Edit

Published June 12, 2015 - Updated October 8, 2020

Did you find this content helpful? Yes No

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us