ORA-12162: TNS: net service name is incorrectly specified how to solve the error ?, Ora-12162tns
"ORA-12162: TNS: net service name is incorrectly specified" appears today when you log on to sqlplus using an oracle user ".
As follows:
[oracle@oracle ~]$ sqlplusSQL*Plus: Release 10.2.0.1.0 - Production on Wed Feb 29 19:19:26 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.Enter user-name: sysEnter password:ERROR:ORA-12162: TNS:net service name is incorrectly specified
The online query is because the ORACLE_SID environment variable is not set.
1. Check whether environment variables are set. Use "echo $ ORACLE_SID" to query them, as shown below:
[oracle@oracle ~]$ echo $ORACLE_SID [oracle@oracle ~]$
2. Set the environment variables and run the "vi. bash_profile" Edit command to add "export ORACLE_SID = oracle13g ".
3. Run the "source. bash_profile" command to make the environment variable take effect.
4. Use the oracle user to log on to sqlplus. As follows:
[oracle@oracle ~]$ sqlplus /nologSQL*Plus: Release 10.2.0.1.0 - Production on Wed Feb 29 19:41:43 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.SQL> conn /as sysdbaConnected to an idle instance.