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


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…


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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s