[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 344
  • Last Modified:

schedule export

How can we schedule export in linux ?
0
tonydba
Asked:
tonydba
1 Solution
 
johnsoneSenior Oracle DBACommented:
What I would do is to write a small script that does the export.  Then schedule that through cron.

Here is the documentation for the cron file (aka crontab) -> http://www.manpagez.com/man/5/crontab/

If your version of crontab supports it, you should run the "crontab -e".  That should bring up the current version of the file and allow you to edit it.  Once you save it, it will be loaded for you.

Be sure that whatever script you write sets up the Oracle environment.  Command run through cron do not execute your login scripts, so absolutely no environment variables will be set up before the script is run.
0
 
DavidSenior Oracle Database AdministratorCommented:
Hi Tony, just as background, can you provide:

-- the database version;
-- whether or not you mean export, or its replacement, datapump (expdp);
--  whether or not the database instance is running in ARCHIEVELOG mode (changes captured as REDO, written, saved as archive logs)

Where I'm going with this, is to educate you on having a recoverable backup.  Export is good for having copies of stuff, but awkward to restore from.
0
 
Devinder Singh VirdiCommented:
Example

Step 1: open crontab using below command
crontab -e

Step2: use below to schedule your script with frequency

0 10 * * * your_exp_script parameter1 parameter2 > log_fileLocation_output.log 2>&1

#* * * * * command to be executed
#- - - - -
#| | | | |
#| | | | ----- day of week (0 - 6) (Sunday=0)  
#| | | ------- month (1 - 12)    
#| | --------- day of month (1 - 31)
#| ----------- hour (0 - 23)
#------------- min (0 - 59)

Using above, backup will start at 10:00 am
0
 
tonydbaAuthor Commented:
fine thanks..
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now