Thursday, December 30, 2010

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


-bash-3.2$ sqlplus / as sysdba;

SQL*Plus: Release 11.2.0.1.0 Production on Thu Dec 30 16:29:38 2010

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

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


Enter user-name:


Yes, this is one of Oracle's friendly and useful error messages. It is so clear from the error message that as soon as we get it, we'll go and set ORACLE_SID to the name of our database and everything will work fine after that.

-bash-3.2$ export ORACLE_SID=abc
-bash-3.2$ sqlplus / as sysdba;

SQL*Plus: Release 11.2.0.1.0 Production on Thu Dec 30 16:34:22 2010

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

No comments: