Skip to content

Instantly share code, notes, and snippets.

@metalrufflez
Created November 21, 2011 14:14
Show Gist options
  • Save metalrufflez/1382723 to your computer and use it in GitHub Desktop.
Save metalrufflez/1382723 to your computer and use it in GitHub Desktop.
Dump an Oracle 10g (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/directory"
#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
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