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: shell script for auto export

Re: shell script for auto export

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 25 Jan 1999 12:08:22 GMT
Message-ID: <36b25e38.23115608@192.86.155.100>


A copy of this was sent to "forums.inprise.com" <stanley_yeh_at_email.asetest.com.tw>
(if that email address didn't require changing) On 25 Jan 1999 03:13:41 GMT, you wrote:

>Hello to All,
>
>I wrote a unix shell script which can automatic export data from my oracle
>database server( Oracle enterprise 7.3.3).This shell script can be executed
>
>by manual, but when I use "crontab" to auto the execution of this shell
>program
>, it generated below error messages. Is there anyone can solve this
>problem
>for me ?
>

your cronjob runs in a clean environment. Your ORACLE_HOME, ORACLE_SID, etc are not set.

My favorite way of running cron jobs is from the root account where I use something like:

...
echo Begin export backup
su - oracle8 -c expbkup
...

the su - oracle8 runs the export backup script with Oracle's environment all set up.

short of that, put the oracle_home/sid into the script

>
>< output >
>
>Your "cron" job
>
>/mnt/oracle/exp_backup/backup
>
>produced the following output:
>
>
>Message 206 not found; No message file for product=RDBMS, facility=EXP:
>Release9
>
>Copyright (c) Oracle Corporatio
>EXP-00008: Message 8 not found; No message file for product=RDBMS,
>facility=EXP
>Error while trying to retrieve text for error ORA-12545
>EXP-00222: Message 222 not found; No message file for product=RDBMS,
>facility=EP
>EXP-00000: Message 0 not found; No message file for product=RDBMS,
>facility=EXPt
>/mnt/oracle/exp_backup/export.out: No such file or directory
>mv: cannot access /mnt/oracle/exp_backup/export.out.Z
>01.25.99.export.Z: No such file or directory
>Interactive mode off.
>
>< File name : backup >
>
>#!/sbin/sh
>cd /mnt/oracle/exp_backup
>/mnt/oracle/product/7.3/bin/exp system/asetadmin<
>/mnt/oracle/script/exp_response
>mv /mnt/oracle/exp_backup/export.out /mnt/oracle/exp_backup/export.out
>compress /mnt/oracle/exp_backup/export.out
>mv /mnt/oracle/exp_backup/export.out.Z /mnt/oracle/exp_backup/`date
>+%m.%d.%y.export.Z`
>
>
>< File name :exp_response >
>
>10240
>/mnt/oracle/exp_backup/export.out
>2
>yes
>yes
>yes
>wafer
>
>
>Thanks in advance.
>
>Regrads,
>Stanley
>
>Email Address: stanley_yeh_at_email.asetest.com.tw
>Telophone No: 886-7-3636663 ~ 1249
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Mon Jan 25 1999 - 06:08:22 CST

Original text of this message

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