windows+oracle环境的RMAN备份计划
备份计划分为三个类型:1、数据库完全备份 2、数据库增量备份 3、归档日志备份
具体执行计划
1、 保存两个完整数据库备份
2、 每周日凌晨4:30开始执行数据库完全备份
3、 每周三凌晨4:30点开始执行数据库增量备份
4、 每隔1小时执行一次归档日志备份
[@more@]修改RMAN配置
命令提示符模式下输入:
rman target /
进入RMAN操作界面,执行:
RMAN>CONFIGURE BACKUP OPTIMIZATION ON;
RMAN>CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
RMAN>CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN>CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘e:databasebakdbnameCTL%U’;
备份脚本
数据库完全备份:
文件路径 e:databasebakdbfullbak.bat
内容:
rman cmdfile='e:databasebakdbfullbak.txt' log='e:databasebaklogFULL%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%.log'
数据库增量备份:
文件路径 e:databasebakdbinc1bak.bat
内容:
rman cmdfile='e:databasebakdbinc1bak.txt' log='e:databasebaklogINC1%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%.log'
数据库归档备份
文件路径 e:databasebakdbarcbak.bat
内容:
rman cmdfile='e:databasebakdbarcbak.txt' log='e:databasebaklogARC%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%.log'
数据库完全备份脚本内容
文件路径 e:databasebakdbfullbak.txt
connect target /
run {
allocate channel c1 type disk;
allocate channel c2 type disk;
backup incremental level 0 database format 'e:databasebakdbnamedbfull%U' plus archivelog format 'e:databasebakdbnamearch%U' delete all input;
release channel c1;
release channel c2;
crosscheck backup;
report obsolete;
delete obsolete;
}
数据库增量备份脚本内容
文件路径 e:databasebakdbinc1bak.txt
connect target /
run {
allocate channel c1 type disk;
allocate channel c2 type disk;
backup incremental level 1 database format 'e:databasebakdbnamedbinc1%U' plus archivelog format 'e:databasebakdbnamearch%U' delete all input;
release channel c1;
release channel c2;
}
数据库归档备份脚本内容
文件路径 e:databasebakdbarcbak.txt
connect target /
run {
allocate channel c1 type disk;
allocate channel c2 type disk;
backup archivelog all format 'e:databasebakdbnamearch%U' delete all input;
release channel c1;
release channel c2;
}
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/73920/viewspace-1051470/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/73920/viewspace-1051470/