Created
November 21, 2011 14:17
-
-
Save metalrufflez/1382732 to your computer and use it in GitHub Desktop.
Dump and Oracle 11g (set it to run houly on cron)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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