>
> Hi Ari,
>
> I'm trying to put in place batch jobs in the crontab, but it seems that I
> have environment problems, because I'm not able to open sqlplus from the
> crontab. I'm working in an AIX environment on Sun Solaris. I tried adding
> "export" environment variables in the batch job with no success. The output
> is the following:
>
> /oracle/products/733/bin/sqlplus not found.
>
> though I have, in the ksh script ran from the crontab, an explicit
> environment variables assignement:
>
> export ORACLE_HOME
> ORACLE_HOME=/oracle/products/733
> export PATH
> PATH=$PATH:$ORACLE_HOME:
>
> then the call to sqlplus:
>
> $ORACLE_HOME/bin/sqlplus scott/tiger << ...etc
>
> in the same ksh script.
>
> Is there a way to have my environment set in the crontab so that all my
> references to SQL will be OK?
>
> Thank you,
>
> Karina.
>
>
You are certainly on the correct path. Crontabs need environment variables
set in Unix operating systems. However, they do not always reflect the default
shell for your user account. For example, cron may be running in ksh but your
default may be csh.
So, you should ensure that the cronjob runs in the ksh by adding this as the
first line in the crontab:
#!/bin/ksh
Best of luck,
-Ari Kaplan
Independent Oracle DBA Consultant
<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
<-> For 160+ Oracle tips, visit my Web Page: <->
<-> <->
<-> www.arikaplan.com <->
<-> <->
<-> email: akaplan@interaccess.com <->
<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
Back to Ari Kaplan's Home Page