让学习成为一种习惯!
全部博文(44)
分类: Oracle
2015-02-09 08:58:31
转自 博客:http://blog.csdn.net/kai27ks/article/details/7938855
之前一直对RMAN有误解,以为设置了过期策略后,就能自动删除。后来发现一直没执行自动删除,还以为是文件没满呢。查看官方文档解释:
You can use the CONFIGURE RETENTION POLICY command to create a persistent and automatic backup retention policy. When a backup retention
policy is in effect, RMAN considers backups of datafiles and control files as obsolete, that is, no longer needed for recovery, according to criteria that
you specify in the CONFIGURE command. You can then use the REPORT OBSOLETE command to view obsolete files and DELETE OBSOLETE to delete them.
说的很明白:RMAN不会自动删除已经废弃的备份!而是需要你手动执行如下步骤
1、report obsolete 打印出过期备份
2、delete obsolete 删除过期备份
官方文档:
一般来说 想实现自动化使用脚本定期执行:delete noprompt obsolete;
很容易混淆的另一种操作:crosscheck
crosscheck是对文件做校验,检查已被删除的文件,将它标记成expired。(如果使用上述命令,不会出现这种情况,多出现于手工删除或文件被破坏)
例:crosscheck archivelog all; ---这时找到多个文件已被删除
delete expired archivelog all; ----删除已失效的归档日志,将其从列表中移走,并释放空间空间。