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: oraenv and cron

Re: oraenv and cron

From: Walter T Rejuney <BlueSax_at_Unforgetable.com>
Date: Fri, 29 Sep 2000 09:30:50 -0400
Message-ID: <39D4998A.E12A57AA@Unforgetable.com>

Joseph T wrote:

> In article <8qu11j$s29$1_at_nnrp1.deja.com>,
> kal121_at_my-deja.com wrote:
> > All the scripts I run are from Oracle's cron file. Each shell script
> > that runs explicitly sources Oracle's .bash_profile. Your config file
> > may be different depending on which shell you are using.
> >
>
> I can't run my usual .profile, since it uses the interactive features of
> oraenv to deal with multiple $ORACLE_SIDs. Presumably using oraenv with
> ORAENV_ASK=NO is the part of my .profile that I need, but it just
> doesn't work unless I su - oracle.
>
> Oh, and I apologize for the atrocious formatting of the original
> question. Somewhere between deja.com's preview and Netscape 6.2, it was
> totally trashed.
>
> > In article <8qtl2j$hqo$1_at_nnrp1.deja.com>,
> > Joseph T <jthvedt_at_my-deja.com> wrote:
> > > Why is it that if I run a shell script containing oraenv from cron
> > > as the
> > > oracle user, it doesn't work; but if I have root run it in cron
> > > with su - oracle -c script_name, it runs?
> [edit]

The .profile thing is no problem. All you have to do is re-write it a bit to only run certain things (i.e. shell variable initialization, etc.) when it is not an interactive shell. When you run from cron you get a non-interactive shell. To determine if you are in an interactive shell or not, parse the contents of $- as it will contain the character "i" (amongst others) in an interactive shell. Received on Fri Sep 29 2000 - 08:30:50 CDT

Original text of this message

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