RMAN-08137

来源:互联网 发布:淘宝店铺推广平台 编辑:程序博客网 时间:2024/05/21 18:42

最近rac+dg环境rman备份日志一致出现错误:

RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture processarchived log file name=+ARCH/jhdb/archivelog/jhdb2/2_8194_884618889.dbf thread=2 sequence=8194

提示归档日志不能被删除,备库或者流需要使用,总之就是归档日志还有用途,不能删除。
在数据库全备的时候,需要删除当前已归档日志,所以报以上错误,这个时候我们可以强制删除,当然这个是不建议的。当出现这个错误的时候我们可以先去备库查询如上不能删除的日志是否存在备库,至于消除锁雾方法有很多。

下面是在MOS上查询到的资料:

CAUSEIf we defer an Archive Destination to a Standby Database, the Primary Database will still consider the Standby Database as existing but temporary unavailable eg. for Maintenance. This can happen if you stop Log Transport Services from the Data Guard Broker or manually defer the State for the Archive Destination.SOLUTIONAs long as the Archive Destination (log_archive_dest_n) is still set, we consider the Standby Database as still existing and preserve the ArchiveLogs on the Primary Database to perform Gap Resolution when the Archive Destination is valid again.There are Situations when this is not wanted, eg. the Standby Database was activated or removed but you still keep the Archive Destination because you want to rebuild the Standby Database later again. In this Case you can set the hidden Parameter "_deferred_log_dest_is_valid" to FALSE (default TRUE) which will consider deferred Archive Destinations as completely unavailable and will not preserve ArchiveLogs for those Destinations any more. It is a dynamic Parameter and can be set this Way:SQL> alter system set "_deferred_log_dest_is_valid" = FALSE scope=both;

另一种解决方法:加force

delete force noprompt archivelog until time 'sysdate-2' ;SQL> alter system set "_deferred_log_dest_is_valid" = FALSE scope=both;

在Oracle 10g 后,RMAN提供了配置归档文件删除策略: configure archivelog deletion policy
该策略对应两个值:
APPLIED ON STANDBY :设置为该值时,当通过附加的 DELETE INPUT 子句删除Standby数据库仍需要的日志时,会提示RMAN-08137错误。不过仍然可以手动地通过 DELETE ARCHIVELOG 方式删除。
NONE :设置为该值时,则不启用归档文件的删除策略。默认情况下就是NONE。

如果报错请执行如下命令:
SQL>alter system set “_log_deletion_policy”=ALL scope=spfile sid=’*’;

设置该参数以后,DB 需要重启。

原创粉丝点击