Skip to content

Instantly share code, notes, and snippets.

@dulichan
Created December 10, 2012 10:02
Show Gist options
  • Save dulichan/4249706 to your computer and use it in GitHub Desktop.
Save dulichan/4249706 to your computer and use it in GitHub Desktop.
Oracle backup for current date and time
# Callable script from an application. The directory is predefined in the backup folder.
echo "Starting the export at "`date`
# su - oracle
#/home/oracle
#cd /DSSNEXP/
cd /u01/app/oracle/product/11.2.0/xe/bin
ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH; export PATH
mkdir /home/backup
DATE=`date +%Y-%m-%d-%r`
echo $DATE
./exp userid=user/password@XE log=exp.log file=/home/backup/$DATE.dmp buffer=50000
echo "Export ended at "`date`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment