Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle TNS: net service name is incorrecly specified

I'm trying to access an Oracle database on an old server we inherited for a client.

I'm confident I have the Oracle database and listener started and working, but when trying to access sqlplus or the exp commands, I'm getting the following error:

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

I have edited the tnsnames.ora file to change the host to 127.0.0.1 rather than an external URL and I am able to successfully tnsping my connection, but am not getting much further.


1 Answers

Try setting the Oracle SID

//for windows server.

set ORACLE_SID=database name

//for linux server

export ORACLE_SID=database name

Ideally, database name here should be SID(Site Id). These evn variable should go in file ".profile" of user "oracle"

like image 173
John McG Avatar answered Sep 05 '25 00:09

John McG



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!