昨天接备份同事电话反应在进行RMAN冷备的过程中报如下错,某个表空间备份失败。
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ch00 channel at 04/25/2015 22:02:30
ORA-19566: exceeded limit of 0 corrupt blocks for file +DATA/dbrac/datafile/tbs_11.11.435678937
经过分析发现坏块导致,且坏块不属于任何对象(空块),以下是本次坏块修复步骤:
1、查找坏块
1)使用RMAN查找坏块
验证整个数据库:
Rman> backup validate check logical database ;
注:当数据库版本低于11g且非归档模式,以上命令必须在数据库处于mounted状态执行
验证单个datafile
Rman> backup validate check logical datafile 11 ;
而后执行以下SQL查看坏块:
SQL>Select * from v$database_block_corruption ;
例如:
validate.sh
#!/bin/bash
source /home/Oracle/.bash_profile
$ORACLE_HOME/bin/rman log=/home/oracle/users/validate.log Backup validate check logical datafile ;
或者validate datafile block , ;
Select * from v$database_block_corruption ;
例如:
validate datafile 11 block 184959440, 184961480,184961481 ;
Select * from v$database_block_corruption ;
8、当第7步确认坏块已消除,即可删除测试表
DROP TABLE users.s purge;
9、切换多次日志及checkpoint
Alter system switch logfile ;
Alter system checkpoint ;
10、删除触发器
DROP trigger CORRUPT_TRIGGER ;
DROP trigger corrupt_trigger1 ;
DROP trigger corrupt_trigger2 ;
: