Thursday, August 16, 2012

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


oracle@oradev801:/opt/oracle INT$  sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Thu Aug 16 16:57:18 2012

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

ERROR:
ORA-12162: TNS:net service name is incorrectly specified
  
Enter user-name:
  
Strange!!
I thought it is a problem with the TNS entry, but after doing some research I came to know that it was a problem with ORACLE_SID, May be ORACLE_SID is not properly set or it was not exported.

oracle@oradev801:/opt/oracle INT$  export ORACLE_SID=XXXXXX
oracle@oradev801:/opt/oracle INT$  echo $ORACLE_SID
XXXXXX
oracle@oradev801:/opt/oracle INT$  sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Thu Aug 16 16:57:18 2012

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

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

SQL>  select instance_name from v$instance;

INSTANCE_NAME
----------------
XXXXXX


On WINDOWS:  set ORACLE_SID=XXXXXX


0 comments:

Post a Comment

Auto Scroll Stop Scroll