首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式碼之家 >> 數據庫知識 >  >> Oracle 資料庫 >> Oracle 資料庫基礎

Oracle 邏輯備份 Shell 腳本:完全、累積、增量備份與 Crontab 排程範例

     編輯:Oracle 資料庫基礎

備份腳本

完全備份 exp_comp.sh

rq=`date +"%m%d"`
su - oracle -c "exp system/manager full=y inctype=complete file=/oracle/export/db_comp$rq.dmp"

累積備份 exp_cumu.sh

rq=`date +"%m%d"`
su - oracle -c "exp system/manager full=y inctype=cumulative file=/oracle/export/db_cumu$rq.dmp"

增量備份 exp_incr.sh

rq=`date +"%m%d"`
su - oracle -c "exp system/manager full=y inctype=incremental file=/oracle/export/db_incr$rq.dmp"

Root Crontab 排程

0 2 1 * * /oracle/exp_comp.sh        # 每月 1 號 02:00 完全備份
30 2 * * 0-5 /oracle/exp_incr.sh     # 週一~六 02:30 增量備份
45 2 * * 6 /oracle/exp_cumu.sh       # 週日 02:45 累積備份

時間表可依需求調整,以上僅為範例。

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved