oracle自動備份資料庫
⑴ oracle中怎麼設置資料庫自動備份
Oracle自動備份的三種方法:
Oracle自動備份資料庫不外乎以下三種方式:
WINDOWS下的任務計劃(At命令)
UNIX下的Crontab
第三方工具如Viritas
在以上三種方式中Viritas屬於第三方工具,很多人可能都沒有接觸,主要說一下windows的任務計劃與unix的cron
1、生成腳本文件,如backup.rcv 假定文件內容如下:
$>cat backup.rcv connect target sys/password rcvcat rman/rman@localname; run{ allocate channel c1 type disk; allocate channel c2 type disk; allocate channel c3 type disk; backup fileaperset 3 format 『/u01/oradata/backup/arch%u_%s_%p』 archivelog all delete input; release channel c1; release channel c2; release channel c3; }
2、生成執行文件在windows上生成backup_archive.bat,內容包括rman cmdfile = backup.rcv 在unix下生成 backup_archive.sh,內容包括oracle/ramn/rman cmdfile = backup.rcv
3、加入調度在windows中用任務計劃向導即可,或使用at命令。在unix中,在目標機器上編寫一個文件,用以啟動Oracle自動備份進程。假定文件名為ORACLE,文件將放在/var/spool/cron/crontabs目錄下
$>cat oracle
0 23 * * 0 backup_archive.sh
#表示星期天23點對資料庫備份
0 12,18 * * * backup_archive.sh
#表示每天12點,18點備份
Crontab文件的每一行由六個域(minutes,hours,day of month,month,day of week,command)組成,域之間用空格或Tab分隔開來。