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: cronjob and script to start rman make's problems

Re: cronjob and script to start rman make's problems

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: Mon, 23 Jul 2001 07:50:27 +0200
Message-ID: <9jgdvl$l63$1@ctb-nnrp1.saix.net>

"achim.altmann" <achim.altmann_at_web.de> wrote

> im from Germany
> please sorry for my bad english language,

Not a problem.

<snipped>
> Please tell me
> what is the problem

I think the problem is that environment is not set. When running a shell script via cron, cron does not run the .profile of that user. This means that ORACLE_HOME, PATH and so, are not set.

Add the following lines to the start of your shell script and see how it works:

--
# check if we have a valid Oracle environment
if [ "$ORACLE_HOME" = "" ]
then
  # ORACLE HOME not set. We assume that .profile
  # was not run, so we execute it ourselves, and
  # redirect STDOUT and STDERR to /dev/null
  . $HOME/.profile 1>/dev/null 2>/dev/null
fi
--

This works under HP-UX's ksh and sh, so I guess this should also work under
Linux's bash.

--
Billy
Received on Mon Jul 23 2001 - 00:50:27 CDT

Original text of this message

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