Skip to content

Instantly share code, notes, and snippets.

@metalrufflez
Created November 21, 2011 14:17
Show Gist options
  • Save metalrufflez/1382732 to your computer and use it in GitHub Desktop.
Save metalrufflez/1382732 to your computer and use it in GitHub Desktop.
Dump and Oracle 11g (set it to run houly on cron)
#!/bin/bash
export ORACLE_HOME="/path/to/oracle/home"
export ORACLE_SID=SID
DB_BKPDIR="/path/to/backup/dir"
#EXPORT DA BASE DE DADOS
echo "Dumping Database"
#${ORACLE_HOME}/bin/exp \"/ as sysdba\" file=$DB_BKPDIR/bkp_hourly.dmp log=$DB_BKPDIR/bkp_hourly.log buffer=3000000 compress=y full=y
$ORACLE_HOME/bin/expdp USERID="'/ as sysdba'" FULL=y DIRECTORY=backup DUMPFILE=bkp_hourly.dmp LOGFILE=bkp_hourly.log
echo "Compressing Dump"
bzip2 -f $DB_BKPDIR/bkp_hourly.dmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment