Schedule Datapump Export in crontab

Jump Ahead

Backups using EXP / EXPDP is at times useful than RMAN as it allows to take backups of specific tables and does not require db in archivelog mode.

Create EXPDP Job

  1. Create a file which contains

EXPDP script: /home/oracle/backup_script

export DATE=$(date +%m_%d_%y_%H_%M)
export ORACLE_SID=orcl
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1

$ORACLE_HOME/bin/expdp username/[email protected] directory=export_dir dumpfile=backup_$DATE.dmp logfile=backup_$DATE.log full=y

2. To schedule EXPDP backup in CRONTAB: Backup every day at 20:00 (8:00 PM)

# crontab –e –u oracle
00 20 * * * /home/oracle/backup_script

3. The first five fields are

  • Minute (0-59)
  • Hour (0-23)
  • Day of month (1-31)
  • Month of year (1-12)
  • Day of week (0-6)

Was this article helpful?

Related Articles

Leave a Comment