Oracle 用rman删除主库的归档出现RMAN-08137

2021/9/19 2:05:26

本文主要是介绍Oracle 用rman删除主库的归档出现RMAN-08137,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

11g dataguard 环境中用rman删除主库的归档,出现 RMAN-08137:
 WARNING: archived log not deleted, needed for standby or upstream capture process

通过下述两个sql检查,发现主库的归档都已经应用到standby库
select max(sequence#) from v$archived_log;
select max(sequence#) from v$archived_log where applied='YES';

尝试用下述命令删除7天前的归档
RMAN>crosscheck archivelog all;
RMAN>delete noprompt archivelog until time 'sysdate-7';

错误如下: 
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process

检查发现数据库开启了附加日志:
select force_logging,supplemental_log_data_min from v$database;
FORCE_LOGGING SUPPLEMENTAL_LOG_DATA_MIN
------------- -------------------------
YES           YES
附加日志之前同步数据时用到的,现在不用了可以关闭掉附加日志
alter database drop supplemental log data;
Database altered

检查dba_capture发现有记录:
select capture_name, status, captured_scn, applied_scn, capture_type from dba_capture;
利用dbms_capture_adm.drop_capture删除相关记录:
exec dbms_capture_adm.drop_capture(capture_name =>'......'); 
PL/SQL procedure successfully completed

删除归档正常
RMAN> delete noprompt archivelog until time 'sysdate-7';


方法二:
最后加上force关键字,手动执行delete noprompt force archivelog until time 'sysdate-14'; 成功将归档删除!



这篇关于Oracle 用rman删除主库的归档出现RMAN-08137的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程