2

Some software I'm writing needs to query an oracle database - the DBA is away for a while, so all I have to go on is some source code from another application that connects to the same database (and I'm not even sure it's current). The java connect string looks like this:

jdbc:oracle:thin:@101.010.101.010:1521:srip

Which the jdbc documentation tells me means that the server address/port is 101.010.101.010:1521 and the 'service name' is srip. I've created a corresponding entry in tnsnames.ora that looks like this:

mydb=
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 101.010.101.010)(PORT = 1521))
    (CONNECT_DATA =
     (SERVICE_NAME = srip)
    )
  )

In the ODBC configuration dialog the oracle client finds the 'mydb' entry and lists it under 'TNS Service Name'. When I try to 'test connection', it returns instantly with error ORA-12514: TNS:listener does not currently know of service requested in connect decsriptor. I guess this means the SERVICE_NAME entry is wrong, maybe it has been changed. Is there any way to find out what service names are available on a remote server that I don't have any other access to?

5

Yes you can do this kind of stuff but you would need either to be granted on the database server either to know the listener password (if one has been set).

Before this, you could:

  1. Edit your tns.ora and replace "SERVICE_NAME" instead of "SID".
  2. Check your sqlnet.ora file for a incorrect "DEFAULT_DOMAIN" directive.
  • Using SID instead of SERVICE_NAME worked, thank you! – K. P. Whitford Feb 22 '11 at 18:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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