Problem with CRONTAB [message #345992] |
Fri, 05 September 2008 08:45 |
Creems
Messages: 70 Registered: July 2007 Location: Johannesburg
|
Member |
|
|
Hi,
I created a crontab file that starts up my oracle instace at a particular time specified in the file.
The start.sh script resides on /home/oracle/ and I edited my crontab as follows:
30 12 * * * /home/oracle/start.sh -- to run @ 12:30 everyday.
Here is the content of start.sh script:
===========================
#!/bin/bash
# Title: start.sh
cd $ORACLE_HOME/bin
./sqlplus /nolog <<EOF
conn /as sysdba;
startup;
EOF
============================
But when the script runs I get the error below:
/home/oracle/start.sh: line 6: ./sqlplus: No such file or directory
Again, when I run the same script (start.sh) from shell it runs successfully.
[oracle@kerrysson ~] ./start.sh --- run successfully.
Please what could be the solution here? Put me through please.
Thanks and regards,
Creems
|
|
|
|
|
Re: Problem with CRONTAB [message #359577 is a reply to message #345992] |
Mon, 17 November 2008 06:33 |
jitheshviswam
Messages: 1 Registered: December 2006 Location: Thrissur, Kerala, India
|
Junior Member |
|
|
You need to set the environment variables inside the script to run the script as cron job. ie., you must set ORACLE_SID and ORACLE_HOME inside the script right after the "#!/bin/bash"; before invoking any other commands.
|
|
|