-
Here is a sample script for your test to undestand things
********************************
#!/bin/sh
user=${1}
pass=${2}
sid=${3}
$ORACLE_HOME/bin/sqlplus $user/$pass@$sid << EOF
select sysdate from dual;
EOF
exit
***********************************
Copy it into a file, example test.sh and change permissions of test.sh
chmod 755 test.sh
execute it as
./test.sh scott tiger SID_name_here
According to your code, it should look as follows
#!/bin/sh
user =${1}
pass =${2}
sid =${3}
${ORACLE_HOME}/bin/sqlplus ${user}@${sid}/${pass} << __eof__
set head off;
commit;
set serveroutput on;
select to_char(sysdate,'DD-MON-YY HH:MI:SS') from dual;
__eof__
exit <--- if you want to exit after the execution of this script.
Good luck,
Sam
-
Finally It worked.
Thank you for your patience, in guiding me.
Thanks again
Badrinath