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: Try to set a oracle cron job on AIX 5.2

Re: Try to set a oracle cron job on AIX 5.2

From: joel garry <joel-garry_at_home.com>
Date: 19 Mar 2007 14:01:27 -0700
Message-ID: <1174338087.469669.212880@e65g2000hsc.googlegroups.com>


On Mar 19, 1:33 pm, philc..._at_rogers.com wrote:
> Hi,
> I am trying to set up a cron job to backup my database daily, the
> following is my shell script, but it
> seems it would not run from the cron, but the manual run is fine, I
> don't know what is missing from my environment:
>
> ==================================
> #!/usr/bin/ksh
> #oracle daily backups
>
> export ORACLE_SID=MYPRD
> export ORACLE_HOME=/home/app/oracle/product/9.2.0
> export ORAENV_ASK=NO;
> . oraenv
>
> WORK_IDEN=/san01/pmmprd/alcprd/exp/exp_myprd_full
>
> exp system/manager file=$WORK_IDEN.dmp log=$WORK_IDEN.log full=y
> direct=y
> exp system/manager parfile=$WORK_IDEN.par
> ~
>
> ===============================================
>
> Any suggestion is appreciated.
>
> Philip

What exactly is your cron entry? Are you redirecting or getting any output, including mail? What is the file protection and ownership on the script? Are you running separate crons for the oracle user, or su - from the root crontab? If the former, have you set up cron.allow (this would be my guess)? Does the at command work for you? Is the #!/usr/bin/ksh the _first_ line of the script, and correct? Try printenv at the beginning of the script, maybe you aren't set up for / usr/local/bin or wherever your oraenv script is - some unix don't put / usr/local/bin in a root login as it is considered bad security.

Also, it shouldn't make a difference, but I'm wondering about the semicolon  after the NO. You might also consider protecting your environment variables with curly braces like ${WORK_IDEN}.dmp just as a good habit.

jg

--
@home.com is bogus.
I want my Dick Tracy wristphone!  http://www.signonsandiego.com/uniontrib/20070317/news_1b17qcom.html
Received on Mon Mar 19 2007 - 16:01:27 CDT

Original text of this message

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