Home » Infrastructure » Linux » Problem with CRONTAB (Oracle 10gR2, Oracle Enterprise Linux AS 5)
Problem with CRONTAB [message #345992] Fri, 05 September 2008 08:45 Go to next message
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 #345993 is a reply to message #345992] Fri, 05 September 2008 08:49 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
In start.sh do the following as very first command & inspect results after invoking via cron & compare to interactive

env | sort -o /tmp/oracle.env

[Updated on: Fri, 05 September 2008 08:50] by Moderator

Report message to a moderator

Re: Problem with CRONTAB [message #345996 is a reply to message #345993] Fri, 05 September 2008 09:02 Go to previous messageGo to next message
Creems
Messages: 70
Registered: July 2007
Location: Johannesburg
Member
I'll try that.


Thanks and regards.


Creems
Re: Problem with CRONTAB [message #359577 is a reply to message #345992] Mon, 17 November 2008 06:33 Go to previous message
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.
Previous Topic: Issue in Sqlplus invoke
Next Topic: How to uninstall Oracle Client on RedHat 4 EL
Goto Forum:
  


Current Time: Thu Mar 28 17:40:30 CDT 2024