1.建议最好打开控制文件的自动备份。
2.如果没有打开控制文件的自动备份,一定注意备份的顺序,无论之前有无备份控制文件,备份全库以及归档之后,在最后一定要再次备份控制文件。
3.使用%U,或者%d%T%s%p 惟一标识备份集。
4.一定要有完整的备份日志留存。
run块示例:
--周日、周三全库备份
代码语言:javascript复制run{
allocate channel c1 device type disk;
backup database tag 'dbfull' format '/backup/dbfull_%d%T%s%p';
backup archivelog all tag 'arch' delete input format '/backup/arch_%d%T%s%p';
backup current controlfile tag 'ctrl' format '/backup/ctrl_%d%T%s%p';
release channel c1;
}
--其余时间归档备份
代码语言:javascript复制run{
allocate channel c1 device type disk;
backup archivelog all tag 'arch' delete input format '/backup/arch_%d%T%s%p';
backup current controlfile tag 'ctrl' format '/backup/ctrl_%d%T%s%p';
release channel c1;
}
--删除obsolete的备份集
代码语言:javascript复制
代码语言:javascript复制allocate channel for maintenance device type disk;
allocate channel for maintenance device type sbt_tape;
crosscheck archivelog all;
crosscheck backup;
delete noprompt obsolete;