How can I connect to an Oracle database through a shell script?

13,804

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
Share:
13,804

Related videos on Youtube

newbie dev
Author by

newbie dev

Programmer, Super User

Updated on September 18, 2022

Comments

  • newbie dev
    newbie dev almost 2 years

    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?

    • 100rabh
      100rabh over 12 years
      check if your listener is up and running
    • newbie dev
      newbie dev over 12 years
      Yes its up only..i can able to connect through sqlplus but couldn't able to do it through shell script..
    • newbie dev
      newbie dev over 12 years
      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..