Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> shell script with sqlplus call not working in cron
Hi,
I have the following problem. On an alpha-machine running Digital UNIX, I run a shell script in cron. This script sets up the env variables ORACLE_BASE, ORACLE_HOME, PATH and ORACLE_SID and does a call to sqlplus after that which runs a sql-script for me. Following is the script:
#!/bin/sh
ORACLE_BASE=<oracle_base_path>
export ORACLE_BASE
ORACLE_HOME=<oracle_home_path>
export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME
export PATH
ORACLE_SID=<my_sid>
export ORACLE_SID
$ORACLE_HOME/bin/sqlplus -s user/password @/path_to_my_script/my_script
exit
If I run the above script from the command line, all is fine and the tables which get changed in the sql-script do change, but as soon as I make an entry in my crontab and let the script run every 5 minutes, it doesn't work anymore and I get error message ORA-12547:TNS:lost contact in the cron log.
Can anybody give me any help here?
Thanks.
Andre
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Tue Sep 14 1999 - 06:47:52 CDT
![]() |
![]() |