i am new to shell script. i have a Oracle server which is remote say “Oracle1” and listening to port 1521 i am trying to remotely connect to it through shell script. i am facing some issue in setting environment variables. my script is.
ORACLE_SID=wctest98;
export ORACLE_SID
ORACLE_HOME=Oracle1.com:1521/opt/oracle/oracle11g/product/11.2.0;
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH;
export PATH
SQLPATH=$ORACLE_HOME/sqlplus/admin;
export SQLPATH
sqlplus -s /NOLOG << EOF
connect wcadmin/wcadmin@Oracle1.com:1521/wctest98
select * from dual;
exit
EOF
i am getting “sqlplus: not found” error. i am doing it for the first time. i have connected to local Oracle System but not to remote server. feel free to edit…
Your
ORACLE_HOME(below) looks incorrect to me. It should not contain the host and port of your oracle server.ORACLE_HOME is the path to wherever you have installed the Oracle client on the local machine. For example, it might be:
Check if you have the
sqplusexecutable in${ORACLE_HOME}/bin.