0

I am getting this error trying to do a test connection on an ODBC DSN with the Oracle Instant client setup on Windows 7 32 bit. I have it working on another machine with Vista 32 bit.

Info:
1. Dir Structure is: c:\oracle\instantclient_11_2. Basic client and instant client files in the instantclient_11_2 directory, just like on the working machine.
2. c:\oracle and c:\oracle\instantclient_11_2 in system path
3. Added TNS_ADMIN to system path and pointed in to c:\oracle
4. tnsnames.ora is copied from the working machine and in c:\oracle
5. sqlnet.ora is in c:\oracle. Working copy just had "TCP.CONNECT_TIMEOUT=5" as an entry but I tried adding: NAMES.DIRECTORY_PATH= (LDAP, TNSNAMES, HOSTNAME) when it wasn't working
6. I can telnet to the oracle server and the 1521 port (defined in tnsnames.ora).

Anything else to check?

urbanmojo
  • 737
  • 3
  • 12
  • 21
  • What is the connect identifier you're using for DSN; is it a TNS alias, or an Easy Connect string, for example? Does the `sqlnet.ora` now match the one on the working machine? – Alex Poole Jun 12 '13 at 08:16
  • -I am just setting up a DSN in the ODBC administrator, specifying the TNS Service name in the tnsnames.ora. The sqlnet.ora is the same--as I state above the working one just has the one line. – urbanmojo Jun 12 '13 at 09:27
  • Here is the tnsnames.ora file contents, I am specifying MIADM in the DSN: `ABCDM = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 172.99.99.99) (PORT = 1521) ) ) (CONNECT_DATA = (SERVICE_NAME = MIADM) ) )` – urbanmojo Jun 12 '13 at 13:03

2 Answers2

0

If yout tnsnames.ora is as you said in a comment, then you're using the wrong value in your DSN. You need to use the TNS alias in the DSN, which is ABCDM. You can't refer to the service name directly, unless you happen to have used that as the alias as well.

Alex Poole
  • 183,384
  • 11
  • 179
  • 318
  • OK, that works. Weird, I was using the "Service Name" on the old machine--MIADM. I checked for other copies of tnsnames.ora on the old machine in case I was missing something. Makes no sense. Why would that be? – urbanmojo Jun 13 '13 at 02:51
  • @user2281976 - I don't really use ODBC, but are you sure both machines are using the same driver for the DSN, and that the old one is actually using the TNS alias - that it isn't specifying the host and port to connect to directly, in which case it would be using the service name `MIADM`? I'm wondering if whoever set that up had a similar issue and bypassed the `tnsnames.ora` in the end. Otherwise, no idea I'm afraid *8-) – Alex Poole Jun 13 '13 at 08:16
  • I'm the one who set the other one up...no bypassing of tnsnames.ora. I usually use JDBC but have to use ODBC in this case....:-( – urbanmojo Jun 13 '13 at 11:40
0

We have found that error to be returned when the application calling it is installed in the Program Files (x86) directory. Reinstalling the program outside that folder will clear the error. Not sure why the Oracle Instant Client won't play nice with programs installed there.