12.2备库rman使用delete删除归档日志报错RMAN-08137: WARNING: archived log not deleted, needed for standby or upstr

Posted lvcha001

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了12.2备库rman使用delete删除归档日志报错RMAN-08137: WARNING: archived log not deleted, needed for standby or upstr相关的知识,希望对你有一定的参考价值。

问题:

客户环境12.2 dg备库环境,定时清理归档脚本并未正常清理归档日志文件。

观察日志可以发现存在如下信息

RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process .

一般情况下,如果在备库环境或者主库环境,配置归档清理测量后,DG环境未应用归档将不允许删除。

本次排查RMAN清理归档策略默认,且无法删除的归档日志在DG视图v$archived_log 中applied列为YES

匹配MOS

RMAN-08137 while Deleting Archived Logs from Standby (文档 ID 2169282.1)

CAUSE

log_archive_dest_2 on standby which points to primary database was deferred :

log_archive_dest_2 <SERVICE_NAME> ASYNC NOAFFIRM valid_for=(online_logfile,primary_role) db_unique_name=<SERVICE_NAME>
log_archive_dest_state_2= DEFER

This is functionality change in Oracle12c with fix of <bug 16082541>:  RMAN DELETES ARCHIVELOGS WHICH HAVE NOT BEEN APPLIED TO A DEFERRED STANDBY

SOLUTION

1.  Enable the destination:

SQL>alter system set log_archive_dest_state_2 = ENABLE;

Once destination 2 is enabled , then Please run the archivelog deletion command on standby from RMAN .

NOTE:  There is no harm in enabling the log_archive_dest_2 on standby , redo will be transported only when standby becomes primary.

2.  If the destination should not be considered, unset the destination rather setting it‘s state to DEFER.  

 

实际情况发现,DG配置远程归档参数,指向主库,且远程归档线程状态为DEFER,按照文档提示,修改为ENABLE后,手工执行归档清理脚本后正常。

 

以上是关于12.2备库rman使用delete删除归档日志报错RMAN-08137: WARNING: archived log not deleted, needed for standby or upstr的主要内容,如果未能解决你的问题,请参考以下文章

为什么 dataguard 应用 归档日志 速度

RMAN备份归档日志ORA-19575

Data Guard备库未应用日志的问题一则

请教一个DATAGUARD备库归档日志清理的问题

12c ADG无法删除备库归档RMAN-08137

设置定时任务用rman删除归档日志脚本