Ora-12154 cannot solve ... with oracle instant client

Here are the details:

  • I installed the oracle 11.2.0.2.0 instant client from the OTN download page on Windows 7 64 bit vm (vmware).
  • I am trying to connect to a remote oracle database, and I can successfully connect to one program using TNS, but not with SQL * Plus and other applications.
  • Attempting to connect to SQL * Plus using @servicename schema, password, etc. gives the above error.
  • To connect through SQL Developer, usually I would use basic connection information and not rely on tnsnames, but when trying to connect normally, they give me: io error: unknown host specified . SQL Developer can successfully connect and query the database if I use the TNS protocol.
  • Trying from other programs gives me the same error as mine with SQL * Plus. Same thing when you try to use the service name from tnsnames.

This is obviously quite unpleasant in order to work in one direction and not in another. I followed all the usual instructions for using the instant client, the directory with instantclient was added to PATH, a TNS_ADMIN entry was created with the directory in the tnsnames.ora file

+1
source share
3 answers

Well, on a whim, I went to change everything in my setup to match the Windows 2003 server that I used to have with an instant client. The main changes were to have the instant client in the folder in the root of the disk (and not in the / oracle / etc program files), but c: / oracle, I know that I saw other messages saying that the oracle was especially characteristic for characters in the directory path, maybe space is also no-no?

I also add a lot of environment variables, anythign, which were on another computer, ORACLE_HOME (to the root of the instance), SQL_PATH (the same) and add the root of the directory to the PATH system variable, and not just to the folder with instantclient files. In any case, I am glad that it works, and any of these changes could be so, although -

+1
source

You can use ProcessMonitor and see what your sqlplus process does. In my case, TNS_ADMIN was correctly defined, but by mistake tnsnames.ora and sqlnet.ora had the dumb extension ".txt" added by default in notepad when I created these files. And since Windows Explorer is set to "Hide extensions for known file types" by default, the naming error was not obvious.

0
source

I installed 12.1 instant client. For me, the problem was solved by creating the file \ network \ admin \ tnsnames.ora. Here's the PowerShell I used:

 $source = "C:\Users\USER1\Desktop\tnsnames.ora" $target = "C:\oracle\product\12.1.0\client_1\network\admin" mkdir $target copy-item $source $target 
0
source

All Articles