1

I am trying to set up Squirrel SQL for the first time on my Ubuntu Desktop. Here is the SQLPlus command I use to connect to my DB:

 sqlplus64 "user/[email protected]:1876/atgpen1.lex.bb.com"

So I try to set this up in Squirrel SQL as follows with the Oracle Thin Driver:

jdbc:oracle:thin:@pashratgdb01.lex.bb.com:1876:atgpen1.lex.bb.com"

When I do this, I get the following error:

java.util.concurrent.ExecutionException: java.lang.RuntimeException: 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


at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:202)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.awaitConnection(OpenConnectionCommand.java:132)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$100(OpenConnectionCommand.java:45)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$2.run(OpenConnectionCommand.java:115)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: 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


at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:171)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$000(OpenConnectionCommand.java:45)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$1.run(OpenConnectionCommand.java:104)
... 5 more
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


at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:743)
at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:666)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:566)
at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:133)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:167)
... 7 more
Caused by: oracle.net.ns.NetException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor


at oracle.net.ns.NSProtocolStream.negotiateConnection(NSProtocolStream.java:275)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:264)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1452)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:496)
... 12 more
5
  • Are you sure the listener is setup to use the fqdn ?
    – Philᵀᴹ
    Mar 3, 2016 at 16:01
  • @Phil I don't understand the question? I can attach to it from SQL Plus. Is there an additional setting I need to attach to it from Squirrel?
    – Thom
    Mar 3, 2016 at 17:01
  • @The Thom i guess there should have' /' instead of ':' .1876/atgpen1.lex.bb.com
    – atokpas
    Mar 3, 2016 at 18:32
  • @The Thom: provide the output of lsnrctl status command from your database server.
    – atokpas
    Mar 3, 2016 at 18:51
  • @JSapkota I don't have access to the server.:(
    – Thom
    Mar 3, 2016 at 19:34

1 Answer 1

3

Your original connection string:

sqlplus64 "user/[email protected]:1876/atgpen1.lex.bb.com"

This specifices atgpen1.lex.bb.com as a service name. The JDBC syntax you used specifies a SID. Service name identifies a service within a database. SID identifies an instance within a database. Those two are not the same.

Instead of this:

jdbc:oracle:thin:@pashratgdb01.lex.bb.com:1876:atgpen1.lex.bb.com"

Use this:

jdbc:oracle:thin:@//pashratgdb01.lex.bb.com:1876/atgpen1.lex.bb.com"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.