ORA-12162

Originally posted from older blog on: Sep 27, 2012

ORA-12162 "TNS:net service name is incorrectly specified" results from improperly setting your ORACLE_SID value.

In Linux, these commands sets ORACLE_HOME and $ORACLE_SID as follows:

ORACLE_HOME=/u01/oracle; export ORACLE_HOME

ORACLE_SID=asdb; export ORACLE_SID

To set these values permanently do this:

As Oracle user…
vi ~/.bash_profile
Add the following at the bottom of the file or append what you have. Paths might need to be altered to match your systm…


PATH=$PATH:$HOME/bin:$ORACLE_HOME:$ORACLE_BIN

export PATH

umask 022
export ORACLE_BASE=/opt/Oracle/app
export ORACLE_BIN=/opt/Oracle/app/product/11.2.0/dbhome_1/bin
export ORACLE_HOME=/opt/Oracle/app/product/11.2.0/dbhome_1/
export ORACLE_UNQNAME=orcl
export ORACLE_SID=orcl