ORA-12162: TNS:net service name is incorrectly specified on Mac OS X Lion

Omanand picture Omanand · Nov 27, 2011 · Viewed 35.3k times · Source

I am trying to connect to an oracle database using oracle sqlplus instant client using tnsnames.ora. But getting this error: ORA-12162: TNS:net service name is incorrectly specified.

I have following environmental value set up :

DYLD_LIBRARY_PATH,TNS_ADMIN, ORACLE_HOME

The location of sqlplus is added to the PATH Variable. My instantclient10_2 deploying is located at ~/Library/oracle direcoty. The oracle folder has all the access to the user.

I am able to connect with TNS using oracle SqlDeveloper. Please help me resolve this issue.

OS Version:- Mac OS X 10.7.2 (Lion)

Answer

phray2002 picture phray2002 · Apr 27, 2017
set ORACLE_SID=YOUR_SID_IN_tnsnames.ora
export ORACLE_SID