Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Generic script for setting up correct cron environment?

Re: Generic script for setting up correct cron environment?

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Wed, 08 May 2002 18:43:51 +0200
Message-ID: <98liduojdqglsde621tsanv5f161v70k5b@4ax.com>


On 8 May 2002 06:56:30 -0700, tim.kearsley_at_milton-keynes.gov.uk (Tim Kearsley) wrote:

>Hi all,
>
>Is there a way to reliably set up the correct environment for Oracle
>in scripts which are to be called from cron? I'm referring to getting
>things like ORACLE_HOME set correctly and hence getting a script to
>point to the correct version of executables like sqlplus etc.
>
>For example, suppose I want a nice, generic script which performs some
>action on a database and has the database SID passed to it as a
>command line argument. How would the script set up the right
>environment relevant to that SID? In several cases in my own
>situation we have multiple Oracle versions on one server. The script
>could go to the oratab file to find ORACLE_HOME, but how would it know
>where oratab is? And to run oraenv it needs to know where oraenv
>lives doesn't it? It seems a bit of a "chicken and egg" scenario. No
>doubt I'm missing something very simple!
>
>Any opinions very welcome.
>
>Regards,
>
>Tim Kearsley
>Milton Keynes Council

but how would it know
where oratab is?

oratab is in a fixed directory, /var/opt/oracle for Solaris, /etc for all other platforms

And to run oraenv it needs to know where oraenv lives doesn't it?

That's why the installation manual requests you to copy dbhome, oraenv, dbshut and dbstart to your /usr/local/bin directory, or whatever is appropiate for your platform. IIRC this is one of the functions of running root.sh

No doubt I'm missing something very simple!

Reading the installation manual for your platform, I guess.

Regards

Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address Received on Wed May 08 2002 - 11:43:51 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US