Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Running Pro*C App via Crontab
Dave Mausner wrote:
>
> In article <5b3het$h79_at_netnews.upenn.edu>,
> ikang_at_gradine.cis.upenn.edu (Insoo Kang) wrote:
> >Does anybody know how to set Oracle environment variables to a
Pro*C
> >application that will be executed via crontab?
>
> here's a crontab entry to use:
>
> * * * * * ksh my_script >>my_script.log 2>&1
>
> and here's the beginning of my_script cron will call:
>
> PATH=${PATH%:}:/usr/local/bin:.
> export ORACLE_SID=WHSPROD
> export ORAENV_ASK=NO
> export ORA_NLS=$ORACLE_HOME/ocommon/nls/admin/data
> export TNS_ADMIN=/csapps/oracle/admin/WHSPROD/network
> oraenv
> <your shell commands here>
>
> Dave Mausner, Managing Consultant, Braun Technology Group, Chicago.
Here's a similar way, which may be simpler.
Under the assumption that all these are set in some single location for all users, eg, "/etc/profile", you could just have the shell script execute that global startup script.
Eg:
my_script contents:
#!/bin/sh
. /etc/profile
my_program_binary
Caveats: this isn't going to always be appropriate. For example, sometimes there are messages for the user stuffed into this script, or any number of other things that can break a cron job.
However, if all it contains is a list of environment variable settings, including those needed for the application, then this should work fine.
alvin_at_c-square.com
NO JUNK MAIL PLEASE!!
Received on Fri Jan 10 1997 - 00:00:00 CST