首页 » ORACLE 9i-23c » How to clear the V$Database_block_corruption view?

How to clear the V$Database_block_corruption view?

如果V$Database_block_corruption 有记录有短时间内无法修复,如果告警天天告确实烦人,几年前有写过一篇Know more about V$BACKUP_CORRUPTION , 这里有个DG 环境中因为primary db 没有启用force logging, 结果Standby db上好多nologging corrupted block. 解决方法之前也有写过 利用RMAN增量备份(Incremental Backup)修复standby 环境中的nologging corupted blocks , 这里我想临时把这些记录清理掉,后期再修复。

从11g 以后填充更新v$database_block_corruption的方法有:

–  Analyze table .. Validate structure

–  CTAS(Create table as Select)

–  Export

– Rman Validate  command

– Rman backup command

数据记录在control file中。在之前文档中有记录In 10.2.0.4, the v$database_block_corruption view基于 v$copy_corruption 和v$backup_corruption. 所以当时的清空 V$Database_block_corruption的方法是:

SQL> execute dbms_backup_restore.resetCfileSection(17); /** clear v$backup_corruption
SQL> execute dbms_backup_restore.resetCfileSection(18); /**clear v$copy_corruption

但是在11g 中使用使用下面的命令,比如要清理这次standby database上的V$Database_block_corruption

1, 从primary database 重建standby controlfile

或者

2,  直接reset controlfile 中的记录

SQL> select count(*) from v$database_block_corruption;
COUNT(*)
----------
2286

SQL> execute dbms_backup_restore.resetCfileSection(35);  /** clear DATABASE BLOCK CORRUPTION
PL/SQL procedure successfully completed.

SQL> select count(*) from v$database_block_corruption;
COUNT(*)
----------
0
打赏

对不起,这篇文章暂时关闭评论。