您的位置:首頁技術文章
文章詳情頁

oracle數據庫增量備份腳本

瀏覽:2日期:2023-11-11 19:58:08
OS :RHEL AS 4 oracle 10g

0備份腳本;#!/bin/bash;# incremental level 0 backup script

source /home/oracle/.bash_profile

current_day=`date +%Y%m%d`;mkdir /home/oracle/RMANBACKUP/$current_day;rman target; / <<EOF;run;{;CONFIGURE CONTROLFILE AUTOBACKUP ON;;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/RMANBACKUP/$current_day/PID-%F';;allocate channel dev1 type disk;;allocate channel dev2 type disk;;allocate channel dev3 type disk;;backup incremental level 0 tag='db0';format '/home/oracle/RMANBACKUP/$current_day/%n_%T_%U' database;;sql 'alter system archive log current';;backup archivelog all format '/home/oracle/RMANBACKUP/$current_day/arc_%n_%T_%U' delete all input;;release channel dev1;;release channel dev2;;release channel dev3;;};EOF

1級累積增量腳本;#!/bin/bash;# incremental level 1 backup script

source /home/oracle/.bash_profile

current_day=`date +%Y%m%d`;incr_day=incr$current_day;mkdir /home/oracle/RMANBACKUP/$incr_day;rman target; / <<EOF;run;{;CONFIGURE CONTROLFILE AUTOBACKUP ON;;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/RMANBACKUP/$incr_day/PID-%F';;allocate channel dev1 type disk;;allocate channel dev2 type disk;;allocate channel dev3 type disk;;backup incremental level 1 cumulative tag='db1';format '/home/oracle/RMANBACKUP/$incr_day/%n_%T_%U' database;;sql 'alter system archive log current';;backup archivelog all format '/home/oracle/RMANBACKUP/$incr_day/arc_%n_%T_%U' delete all input;;release channel dev1;;release channel dev2;;release channel dev3;;};EOF

每天RMAN出來的backup set集合到一個文件夾下面;

標簽: Oracle 數據庫
相關文章:
国产综合久久一区二区三区