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 -> Generic script for setting up correct cron environment?

Generic script for setting up correct cron environment?

From: Tim Kearsley <tim.kearsley_at_milton-keynes.gov.uk>
Date: 8 May 2002 06:56:30 -0700
Message-ID: <725736ef.0205080556.b86b474@posting.google.com>


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 Received on Wed May 08 2002 - 08:56:30 CDT

Original text of this message

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