oracle imp/exp 備份使用
阿新 • • 發佈:2019-02-02
linux備份指令碼:
export ORACLE_BASE=/u01/oradev/db/tech_st
export ORACLE_HOME=/u01/oradev/db/tech_st/11.1.0export ORACLE_SID=DEV
export PATH=$PATH:$ORACLE_HOME/bin
export NLS_LANG=AMERICAN_AMERICA.UTF8
d=$(date '+%Y%m%d%k%M')
exp username/password consistent=Y file=/u01/oradev/backup/$d.dmp log=/u01/oradev/backup/$d.log
zip -m /u01/oradev/backup/$d.zip /u01/oradev/backup/$d.dmp /u01/oradev/backup/$d.log
find /path -mtime +30 -type f -name \*.zip -exec rm -f {} \;
檢視:
imp username/password file=xxxx.dmp show=y rows=n log=xxxxx.log full=y tables=table1,table2,table3;
在pl/sql中使用imp命令需在前面加host:
host imp username/password file=D:\Destop\xxxx.dmp full=y ignore=y;