cron job does not run oracle script
670058Feb 3 2010 — edited Feb 3 2010Hi,
I have a Solaris 10 OS running oracle 10g. I have created a cron job with ORACLE user. I have scheduled the job to run every one minute but I get error. When I run the script from the command line and I have no problem.
I know my problem is setting oracle environment. Because of that I have tried several methods and it did not work. For instance I have included following lines of codes to the script but still I get errors. I will appreciate your input.
I have included following lines of code to the script:
1: did not work
export ORAENV_ASK=NO;
. oraenv;
2: set path, ORACLE_HOME, ORACLE_SID in the script and did not work
cron job:
* * * * * /u01/app/oracle/scripts/script1.ksh >> /u01/app/oracle/logs/script1.log 2>&1
script1.ksh
#!/bin/ksh
bdump=`${ORACLE_HOME}/bin/sqlplus -s /nolog <<EOF
connect / as sysdba ;
set head off;
set feedback off;
set verify off;
select value from v\\$parameter where name='background_dump_dest';
exit;
EOF `
echo $bdump
when it run, I get following error:
/bin/sqlplus: not found