背景:
oracle 11.2.0.3 adg断开后,主库在完成备份后执行delete noprompt obsolete device type disk.无法识别过期的归档并删除,几乎导致归档空间爆满。
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
分析:
1.可能与DG断开有关,应为该部份日志,未成为传到备份不允许删除。
2. 检查rman 的配置,show all 未启用日志删除策略。
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
CONFIGURE ARCHIVELOG DELETION POLICY TO appl
lied on standby; --未在本地环境使用
CONFIGURE ARCHIVELOG DELETION POLICY TO shipped to all standby;
--未在本地环境使用
3.有可能是oracle的bug,详细见
RMAN-08137 When deleting archivelogs even when Streams CAPTURE does not require them [ID 1079953.1]
Bug 12412131 - Archivelog backups are not being deleted by 'DELETE OBSOLETE' (文档 ID 12412131.8)
RMAN Is Not Reporting Old Archive Log Files As Obsolete (文档 ID 1936141.1)
[该技术文档更接近我所遇到的情况]
按文档描述,进行如下 诊断:
rman target catalog debug trace='rman_debug.trc'
rman target / debug trace='/u01/dba_log/rman_debug.trc'
delete noprompt obsolete device type disk;
处理:
1. 临时解决,使用手工处理强行删除。
delete noprompt force archivelog all completed before to_date('20170329','yyyymmdd')";
2.[文档 ID 1936141.1]提到的方案,
After recreating the standby database and enabling log_archive_dest_2, the delete obsolete was able to delete the archivelog copies.其实就是重建DG,但是我实际上没有DG关系了。于是产生第三步的衍生解决方案。
3. 衍生的解决办法[最终方案]:
3.1 将主库的log_archive_dest_2置空,命令如下:
alter system set log_archive_dest_2='' scope=both sid='*';
3.2 启用log_archive_dest_stat_2,命令如下:
alter system set log_archive_dest_state_2=enable scope=both sid='*';
3.3 重新登录到rman,删除过期文件,结果:成功删除 ,命令如下:
rman target /
run{
delete noprompt obsolete device type disk;
}