Monday, January 10, 2011

ORA-12162: TNS:net service name is incorrectly specified

Always check out the original article at http://www.oraclequirks.com for latest comments, fixes and updates.
ORA-12162: TNS:net service name is incorrectly specified
If you see this message, probably you tried to connect to an oracle instance without providing a service name on a linux/unix box, for instance:
sqlplus SYS AS SYSDBA
This command may succeed only if in the client environment exists a variable called ORACLE_SID containing a default service name. For instance in the case of Oracle XE, the environment variable ORACLE_SID must contain the string XE. You can check whether such variable is currently defined for the current OS user by executing the command EXPORT on a linux/unix box.

On Windows boxes apparently ORA-12162 is replaced by ORA-12560 until 10gR2, but i could not verify this on more recent releases.
ORA-12560: TNS:protocol adapter error
This error is returned both when ORACLE_SID is undefined as environment variable or as registry key or when its value is incorrect. I ignore if there can be different scenarios leading to ORA-12162 on Windows platforms.

See message translations for ORA-12162 and search additional resources.

No comments:

Post a Comment

I appreciate your comment however bear in mind that I might not have the time to reply soon.
Normally I do not reply to all comments but I am glad if you found something useful or if you learned something new, in that case I strongly encourage you to promote the article with the +1 google button.
Flavio