Linux下Oracle定时备份

发布于 2014-05-27  60.43k 次阅读


ORACLE_BASE=/u01/app/oracle;

export ORACLE_BASE;

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_2;

export ORACLE_HOME;

ORACLE_SID=szzx;

export ORACLE_SID;

LD_LIBRARY_PATH=$ORACLE_HOME/lib;

export LD_LIBRARY_PATH;


d=$(date -d today +"%Y-%m-%d");

export d;

$ORACLE_HOME/bin/exp csch/ql56sz@szzx file=/u01/backup/backup.dmp log=/u01/backup/log.log owner=csch;

zip -m /u01/backup/$d.zip /u01/backup/backup.dmp /u01/backup/log.log;