I have tried to connect to an Oracle database using the below command:

sqlplus -s LOGIN/PASSSWD@SERVERNAME:ORA_PORT/SERVICE_NAME

However I couldn't connect. It was throwing the following error:

ORA-12541: TNS: no listener.

How can I fix this?

link|improve this question

60% accept rate
check if your listener is up and running – Sathya Dec 16 '11 at 18:10
Yes its up only..i can able to connect through sqlplus but couldn't able to do it through shell script.. – Vel Dec 16 '11 at 18:14
and how are you connection to SQLPlus? What's the exact command? – Sathya Dec 17 '11 at 6:29
conn username/password is command i used to connect through SQLPlus..Also system throws ORA-12162 TNS:net service name is incorrectly specified error after ORA-12541: TNS: no listener.. – Vel Dec 17 '11 at 7:33
feedback

1 Answer

up vote 0 down vote accepted

You're entering the wrong TNS Name while connecting. Check the TNSNames defined in $oracle_home\network\admin\tnsnames.ora and use the defined TNS Name as

sqlplus -s LOGIN/PASSSWD@tnsname
link|improve this answer
It works perfectly.. Thanks – Vel Dec 19 '11 at 7:40
you're welcome @Vel. – Sathya Dec 19 '11 at 8:12
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.