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: <sybrandb_at_hccnet.nl>
Date: Mon, 19 Mar 2007 23:23:15 +0100
Message-ID: <v63uv2tt2eaqp4tahhajmtmrqeqdlgjaq0@4ax.com>


On 19 Mar 2007 14:52:49 -0700, philchan_at_rogers.com wrote:

>On Mar 19, 5:20 pm, "Matthias Hoys" <a..._at_spam.com> wrote:
>> <philc..._at_rogers.com> wrote in message
>>
>> news:1174336400.261141.70360_at_y66g2000hsf.googlegroups.com...
>>
>>
>>
>>
>>
>> > Hi,
>> > I am trying to set up acronjobto backup my database daily, the
>> > following is my shell script, but it
>> > seems it would not run from thecron, but the manual run is fine, I
>> > don't know what is missing from my environment:
>>
>> > ==================================
>> > #!/usr/bin/ksh
>> > #oracledaily 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
>>
>> Do you have exp in your path ? Try to add export
>> PATH=$PATH:$ORACLE_HOME/bin, or the full path to the exp executable.
>>
>> Matthias- Hide quoted text -
>>
>> - Show quoted text -
>
>Hi Joel and Matthias,
>
> Thanks a lot for giving me so much suggestions, here are my
>corrections to my script:
>
># Schedule of daily oracle backups
>02 19 * * * /san01/pmmprd/alcprd/exp/exp_myprd.sh
>
>Yes I am running separate crons for the oracle, no need for cron.allow
>as long as oracle is not in cron.deny.
>
>The shell is correct, because I got the shell from env. But you gave
>me two suggestions:
>
> 1. Take out the semicolon from NO
> 2. add the line export PATH=$PATH:$ORACLE_HOME/bin
>
>I re-scheduled it to run this evening again. Let's see if it works
>tommorrow.
>
>Here is my modified script:
>
>==========================================
>#!/usr/bin/ksh
>#oracle daily backups
>
>export ORACLE_SID=MYPRD
>export ORACLE_HOME=/home/app/oracle/product/9.2.0
>export PATH=$PATH:/home/app/oralce/product/9.2.0/bin
>export ORAENV_ASK=NO
>. oraenv
>
>WORK_IDEN=/san01/pmmprd/myprd/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
>
>=======================================
>
>
>Thanks you so much again.
>
>
>Philip

Export should NOT be considered a backup. I would reconsider your strategy asap.
An export is a *logical* dump, and it won't enable you to recover your database to the moment it crashed.

--
Sybrand Bakker
Senior Oracle DBA
Received on Mon Mar 19 2007 - 17:23:15 CDT

Original text of this message

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