1831658 Members
2160 Online
110029 Solutions
New Discussion

Schedule Oracle Export

 
SOLVED
Go to solution
Adrian Sobers2
Super Advisor

Schedule Oracle Export

I would like to add the scheduling of a schema level export as part of our Backup and Recovery plan.

We are running Oracle 8.1.7.4 on HP-UX 11i. I would like to export the schema IRD to this location on the HP-UX box:

/var/export

I would like to do this every week on Saturday morning at about 3am.

How do I go about this under HP-UX?

Any help would be greatly appreciated.
8 REPLIES 8
Sanjay_6
Honored Contributor

Re: Schedule Oracle Export

Hi,

do this through cron,

use oracle id (if you have one) to schedule this job through cron.

Do "man crontab" on more help on setting up cron jobs.

Hope this helps.

Regds

John Poff
Honored Contributor

Re: Schedule Oracle Export

Hi,

One way to do it would be to write a shell script for your Oracle user account to do the export, and then you can use cron to schedule that script to run on Saturday mornings at 3am.

JP
Adrian Sobers2
Super Advisor

Re: Schedule Oracle Export

I will use my oracle user id to run this cron job. Here is my planned entry to the crontab file to run the export every Saturday at 3am:

0 3 * * 6 (cd $ORACLE_HOME/scripts; sh export.sh)

Does this look ok?


John Poff
Honored Contributor
Solution

Re: Schedule Oracle Export

I would not count on cron knowing about your environment variables, such as $ORACLE_HOME. You'll probably have better success if you spell out the path explicitly:

0 3 * * 6 /oracle/app/oracle/scripts/export.sh

Assuming here that your ORACLE_HOME is /oracle/app/oracle. Also, cron runs with the POSIX shell and does not include the user environment, so your script should set any environment variables needed.

I also like to redirect the output of the script to a log file, so you could have something like this at the end after 'export.sh':

>/some/dir/export.logfile

Or you can redirect output inside your export.sh script.

JP



Adrian Sobers2
Super Advisor

Re: Schedule Oracle Export

Yes I've thought it over and I will go with this:

0 3 * * 6 /home/oracle/export.sh >> /home/oracle/export.log

Michael Schulte zur Sur
Honored Contributor

Re: Schedule Oracle Export

Hi,

cron will not give you $ORACLE_HOME. You will have to set it yourself. I would suggest giving cron the full path shell script then first thing in the shell get the oracle environment and then do the export.
0 3 * * 6 /oracle/app/oracle/products/920/scripts/sh export.sh
and inside
. /path/oracle.env.sh
export ....

greetings,

Michael
Marcel Boogert_1
Trusted Contributor

Re: Schedule Oracle Export

Hi there,

In cron I always use the root and then something like:

su - -c /oracle/app/oracle/products/920/scripts/sh export.sh >> /home/oracle/export.log

Regards, MB.
Adrian Sobers2
Super Advisor

Re: Schedule Oracle Export

Thanks for help all.