unable to schedule job in cron

Hi,

from normal user(oracle) i am unable to run scheduled job in cron:
os version:
bash-2.03$ uname -a
SunOS sumail02 5.8 Generic_117350-39 sun4u sparc SUNW,Ultra-60

bash-2.03$ crontab -l
55 * * * * sh /oracle/statistics.sh > /dev/null 2>&1
bash-2.03$ cat /oracle/statistics.sh
/oracle/bin/svrmgrl << EOF
connect inventory/inventory;
set serveroutput on size 900000
spool /oracle/tablesanalyze.txt
execute GATHER_STATS;
spool off
EOF

if i run manually the .sh file it will run and if i scehdule in cron it won't run:

error is :
bash-2.03$ cat tablesanalyze.txt
BEGIN
*
ORA-03114: not connected to ORACLE

is something i missed.

helpfull is appreciated:

Thanks

Prakash

When you run the job manually, you'll be using all of the environment set up in your profile. When the job runs under cron, that profile's not there.
Three choices...
Source your profile in cron...

Source your profile in the script

Or just add the required environment variables to the script...

HTH

Jerry

Hi JerryHone,

Thanks for your inputs and it worked for me.

Cheers

Prakash G R