一.全库备份
run {
configure device type disk parallelism 2;
configure retention policy to recovery window of 7 days;
configure controlfile autobackup on;
allocate channel c1 device type disk;
allocate channel c2 device type disk;
backup copies 2 database format '/rmanbk/1/full_%s_%d_%U','/rmanbk/2/full_%s_%d_%U';
backup copies 2 archivelog all delete all input format '/rmanbk/1/arch_%s_%d_%U','/rmanbk/2/arch_%s_%d_%U';
crosscheck backup;
delete noprompt expired backup;
crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt obsolete;
sql 'alter system archive log current';
release channel c1;
release channel c2;
}
configure device type disk parallelism 2;
configure retention policy to recovery window of 7 days;
configure controlfile autobackup on;
allocate channel c1 device type disk;
allocate channel c2 device type disk;
backup copies 2 database format '/rmanbk/1/full_%s_%d_%U','/rmanbk/2/full_%s_%d_%U';
backup copies 2 archivelog all delete all input format '/rmanbk/1/arch_%s_%d_%U','/rmanbk/2/arch_%s_%d_%U';
crosscheck backup;
delete noprompt expired backup;
crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt obsolete;
sql 'alter system archive log current';
release channel c1;
release channel c2;
}
二.增量备份
0级全库备份
run {
configure device type disk parallelism 2;
configure retention policy to recovery window of 7 days;
configure controlfile autobackup on;
allocate channel c1 device type disk;
allocate channel c2 device type disk;
backup copies 2 incremental level=0 database format '/rmanbk/1/full_%s_%d_%U','/rmanbk/2/full_%s_%d_%U';
backup copies 2 archivelog all delete all input format '/rmanbk/1/arch_%s_%d_%U','/rmanbk/2/arch_%s_%d_%U';
crosscheck backup;
delete noprompt expired backup;
crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt obsolete;
sql 'alter system archive log current';
release channel c1;
release channel c2;
}
configure device type disk parallelism 2;
configure retention policy to recovery window of 7 days;
configure controlfile autobackup on;
allocate channel c1 device type disk;
allocate channel c2 device type disk;
backup copies 2 incremental level=0 database format '/rmanbk/1/full_%s_%d_%U','/rmanbk/2/full_%s_%d_%U';
backup copies 2 archivelog all delete all input format '/rmanbk/1/arch_%s_%d_%U','/rmanbk/2/arch_%s_%d_%U';
crosscheck backup;
delete noprompt expired backup;
crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt obsolete;
sql 'alter system archive log current';
release channel c1;
release channel c2;
}
1级增量备份
run {
configure device type disk parallelism 2;
configure retention policy to recovery window of 7 days;
configure controlfile autobackup on;
allocate channel c1 device type disk;
allocate channel c2 device type disk;
backup copies 2 incremental level=1 database format '/rmanbk/1/full_%s_%d_%U','/rmanbk/2/full_%s_%d_%U';
backup copies 2 archivelog all delete all input format '/rmanbk/1/arch_%s_%d_%U','/rmanbk/2/arch_%s_%d_%U';
crosscheck backup;
delete noprompt expired backup;
crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt obsolete;
sql 'alter system archive log current';
release channel c1;
release channel c2;
}
configure device type disk parallelism 2;
configure retention policy to recovery window of 7 days;
configure controlfile autobackup on;
allocate channel c1 device type disk;
allocate channel c2 device type disk;
backup copies 2 incremental level=1 database format '/rmanbk/1/full_%s_%d_%U','/rmanbk/2/full_%s_%d_%U';
backup copies 2 archivelog all delete all input format '/rmanbk/1/arch_%s_%d_%U','/rmanbk/2/arch_%s_%d_%U';
crosscheck backup;
delete noprompt expired backup;
crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt obsolete;
sql 'alter system archive log current';
release channel c1;
release channel c2;
}
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26839123/viewspace-735913/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26839123/viewspace-735913/