alert日志报以下提示:

 Corrupt block relative dba: 0x04c20df1 (file 19, block 134641)
Fractured block found during backing up datafile
Data in bad block:
type: 40 format: 2 rdba: 0x04c20df1
last change scn: 0x0000.189926c6 seq: 0x2 flg: 0x04
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x26c52802
check value in block header: 0xd25a
computed block checksum: 0x28b1
Reread of blocknum=134641, file=/oradata/omsdb1/OMS_DATA12.dbf. found same corrupt data
Reread of blocknum=134641, file=/oradata/omsdb1/OMS_DATA12.dbf. found same corrupt data
Reread of blocknum=134641, file=/oradata/omsdb1/OMS_DATA12.dbf. found same corrupt data
Reread of blocknum=134641, file=/oradata/omsdb1/OMS_DATA12.dbf. found same corrupt data
Reread of blocknum=134641, file=/oradata/omsdb1/OMS_DATA12.dbf. found same corrupt data

根据上述信息得知19号数据文件的134641为坏块,可以使用DBV工具或者RMAN来检查坏块信息

dbv:

 [oracle@ASZAAS-OMS01 ~]$ dbv file=/oradata/omsdb1/OMS_DATA12.dbf

 DBVERIFY: Release 11.2.0.4.0 - Production on Fri Jun 29 10:57:30 2018

 Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

 DBVERIFY - Verification starting : FILE = /oradata/omsdb1/OMS_DATA12.dbf
Page 134641 is influx - most likely media corrupt
Corrupt block relative dba: 0x04c20df1 (file 19, block 134641)
Fractured block found during dbv:
Data in bad block:
type: 40 format: 2 rdba: 0x04c20df1
last change scn: 0x0000.189926c6 seq: 0x2 flg: 0x04
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x26c52802
check value in block header: 0xd25a
computed block checksum: 0x28b1 DBVERIFY - Verification complete Total Pages Examined : 3932160
Total Pages Processed (Data) : 164199
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 9003
Total Pages Failing (Index): 0
Total Pages Processed (Other): 3757308
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Empty : 1649
Total Pages Marked Corrupt : 1
Total Pages Influx : 1
Total Pages Encrypted : 0
Highest block SCN : 421782991 (0.421782991)

rman:

 RMAN> backup validate datafile 19;

 Starting backup at 29-JUN-18
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00019 name=/oradata/omsdb1/OMS_DATA12.dbf
channel ORA_DISK_1: backup set complete, elapsed time: 00:08:16
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
19 FAILED 0 1649 3932160 421804976
File Name: /oradata/omsdb1/OMS_DATA12.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 164199
Index 0 9001
Other 1 3757311 validate found one or more corrupt blocks
See trace file /u01/app/oracle/diag/rdbms/omsdb1/omsdb1/trace/omsdb1_ora_20078.trc for details
Finished backup at 29-JUN-18

可以根据文件号和块号查出损坏的是对象,表还是LOB segment

 select tablespace_name,segment_type,owner,segment_name from dba_extents where file_id=19 and 134641 between block_id AND block_id + blocks - 1;

19是文件号,134641是block号

如果是对象,可以重建:

alter index indexname rebuild

如果是表,可以使用10231事件忽略坏块,然后使用CTAS方式重建表最后rename table,别忘记rebuild index

alter session SET EVENTS '10231 trace name context forever,level 10';
create table tab_new as select * from tab;
rename tab to tab_bak;
rename tab_new to new;
alter index indexname rebuild;
alter session SET EVENTS '10231 trace name context off';

如果损坏的是LOB segment,先找出segment信息:

select owner, segment_name, segment_type from dba_extents where file_id = 19 and 134641 between block_id and block_id + blocks - 1;

输出如下:

 owner=OMSADMIN
segment_name=SYS_LOB0000087489C00007$$
segment_type=LOBSEGMENT

找到表名和LOB字段:

 select table_name, column_name from dba_lobs where segment_name = 'SYS_LOB0000087489C00007$$' and owner = 'OMSADMIN';

输出如下:

 table_name = OMS_LOGINFOR
column_name = CONTENT

找到坏块的bad rowid,使用以下plsql脚本:

 create table bad_rows (row_id ROWID,oracle_error_code number);

 declare
n number;
error_code number;
bad_rows number := 0;
ora1578 EXCEPTION;
PRAGMA EXCEPTION_INIT(ora1578, -1578);
begin
for cursor_lob in (select rowid rid, &lob_column from &table_owner.&table_with_lob) loop
begin
n:=dbms_lob.instr(cursor_lob.&lob_column,hextoraw('')) ;
exception
when ora1578 then
bad_rows := bad_rows + 1;
insert into bad_rows values(cursor_lob.rid,1578);
commit;
when others then
error_code:=SQLCODE;
bad_rows := bad_rows + 1;
insert into bad_rows values(cursor_lob.rid,error_code);
commit;
end;
end loop;
dbms_output.put_line('Total Rows identified with errors in LOB column: '||bad_rows);
end;
/

Enter value for lob_column: CONTENT
Enter value for table_owner: OMSADMIN
Enter value for table_with_lob: OMS_LOGINFOR 
可以查询bad rowid

select * from bad_rows;
ROW_ID ORACLE_ERROR_CODE
1 AABIz+AATAAAf2jAAB 1578
2 AABIz+AATAAAf2zAAA -1555
3 AABIz+AATAAAf2zAAB -1555
4 AABIz+AATAAAf7kAAA -1555

更新空LOB字段来避免ORA-1578,ORA-26040,如果是CLOB类型,将empty_blob()改为empty_clob()

update &table_owner.&table_with_lob set &lob_column = empty_clob() where rowid in (select row_id from bad_rows);

将bad rowid lob块移到其他表空间:

 alter table &table_owner.&table_with_lob move LOB (&lob_column) store as (tablespace &tablespace_name);

最后重建索引rebuild index

Corrupt block relative dba: 0x04c20df1的更多相关文章

  1. Oracle corrupt block(坏块) 详解

    转自:http://blog.csdn.net/tianlesoftware/article/details/5024966 一. 坏块说明 1.1 相关链接 在看坏块之前,先看几个相关的链接,在后面 ...

  2. ImageConverter引起的 invalid address or address of corrupt block 0xb7feab58 passed to dlfree

    虹软人脸识别,其方法要传NV21格式的byte[], github上有一个虹软的Demo,是不是虹软工作人员写的不清楚,这个Demo里bitmap转NV21格式byte[]用的是一个第三方库https ...

  3. 关于Oracle备份中的fractured block

    One danger in making online backups is the possibility of inconsistent data within a block. For exam ...

  4. ORA-19566: exceeded limit of 0 corrupt blocks for file E:\xxxx\<datafilename>.ORA.

    How to Format Corrupted Block Not Part of Any Segment (Doc ID 336133.1) To BottomTo Bottom In this D ...

  5. ORA-00600 3020 ORA-10567案例

    PlateSpin克隆复制出的Oracle数据库服务器,往往启动数据库实例都会遇到一些杂七杂八的问题.今天测试DR环境时又遇到了一个特殊场景,在此之前,我已经遇到了下面两起案例: ORA-00600: ...

  6. 使用BBED模拟Oracle数据库坏块

    BBED(OracleBlockBrowerandEDitor Tool),用来直接查看和修改数据文件数据的一个工具,是Oracle一款内部工具,可以直接修改Oracle数据文件块的内容,在一些极端恢 ...

  7. dbms_file_transfer使用简介

    dbms_file_transfer这个包可以在两个位置传输文件,分别可以有以下位置: a 从一个asm diskgroup传输到另外一个asm diskgroup b 从一个asm diskgrou ...

  8. Oracle数据块损坏的恢复实例

    测试环境:11.2.0.4 1.构建数据块损坏的测试环境 2.有备份:常规恢复坏块 3.无备份:跳过坏块 1.构建数据块损坏的测试环境 1.1 创建测试表 --Create Table t_test ...

  9. 【BBED】BBED模拟并修复ORA-08102错误

    [BBED]BBED模拟并修复ORA-08102错误 1.1  BLOG文档结构图 1.2  前言部分 1.2.1  导读和注意事项 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其 ...

随机推荐

  1. win8.1和wp8.1共用代码,需要注意的一些问题

    最近写了一个应有,使用了mvvmlight,把viewmodel.model.common之类的代码都放到了shared共享,写下来才发现,有不少问题是自已下手之前没注意到的,有些地方实在没法中途改了 ...

  2. 【BZOJ1101】[POI2007] Zap(莫比乌斯反演)

    点此看题面 大致题意: 求\(\sum_{x=1}^N\sum_{y=1}^M[gcd(x,y)==d]\). 一道类似的题目 推荐先去做一下这道题:[洛谷2257]YY的GCD,来初步了解一下莫比乌 ...

  3. python实现剑指offer删除链表中重复的节点

    题目描述 在一个排序的链表中,存在重复的结点,请删除该链表中重复的结点,重复的结点不保留,返回链表头指针. 例如,链表1->2->3->3->4->4->5 处理后 ...

  4. MFC-[转]基于MFC的ActiveX控件开发

    作者:lidan | 出处:博客园 | 2012/3/13 16:10:34 | 阅读22次 ActiveX 控件是基于组件对象模型 (COM) 的可重用软件组件,广泛应用于桌面及Web应用中.在VC ...

  5. “System.AccessViolationException”类型的未经处理的异常在 System.Data.dll 中发生 其他信息: 尝试读取或写入受保护的内存。这通常指示其他内存已损坏

    用管理员身份运行CMD:netsh winsock reset就可以解决

  6. swift 循环语句

    // // main.swift // switch // // Created by lanou on 16/10/21. // Copyright (c) 2016年 lanou. All rig ...

  7. Java 获取Web项目相对webapp地址

    例如, import java.io.File; import java.io.FileInputStream; import javax.servlet.http.HttpServletReques ...

  8. python 进度条 打印

  9. Date.prototype.Format---对Date的扩展

    // 对Date的扩展,将 Date 转化为指定格式的String // 月(M).日(d).小时(h).分(m).秒(s).季度(q) 可以用 1-2 个占位符, // 年(y)可以用 1-4 个占 ...

  10. 动态规划、记忆化搜索:HDU1978-How many ways

    Problem Description 这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m).游戏的规则描述如下: 1.机器人一开始在棋盘的起始点并有起始点所标 ...