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. vue安装环境

    vue安装环境 1. 安装node.js 先在电脑上安装node.js, https://nodejs.org/en/ 可以点击链接安装. 安装成功后,在命令板里检测是否安装成功, node -v 2 ...

  2. python序列化(数据本地存放持久性存储)和反序列化

    http://blog.csdn.net/uestcyao/article/details/7874817 #读取图片并存储为矩阵 from scipy.misc import imread im = ...

  3. AngularJs学习笔记-组件生命周期

    组件生命周期 (1)组件生命周期钩子 constructor:组件创建时被创建 ngOnChanges: 父组件修改或初始化子组件的输入属性时被调用,如果子组件没有输入属性,则永远不会被调用,它的首次 ...

  4. C# FileStream对象

    FileStream对象表示在磁盘或网络路径上指向文件的流.当类提供向文件读写字节的方法时,经常使用StreamReader或StreamWriter执行这些功能.这是因为FileStream类操作字 ...

  5. 流行JAVA开发工具

    流行JAVA开发工具 正所谓工欲善其事必先利其器,我们在开发java语言过程中同样需要依款不错的开发工具,目前市场上的IDE很多,本文为大家推荐以下下几款java开发工具: Eclipse(推荐):另 ...

  6. webpack 4.x 解决 webpack-dev-server工具在webpack构建的项目中使用问题

    webpack-dev-server工具能实现自动打包编译和热更新 首先将webpack-dev-server安装到项目中 npm install webpack-dev-server -D 这时在命 ...

  7. linux下通过phpize为php在不重新编译php情况下安装模块memcache

    通过phpize为php在不重新编译php情况下安装模块memcache 1. 下载    wget http://pecl.php.net/get/memcache-2.2.4.tgz     解压 ...

  8. django 图片上传与显示

    由于图片上传的需要,学习了一波上传 1. 上传 前端代码 <form action="写上相应的定向位置" method="post" enctype=& ...

  9. Linux菜鸟起飞之路【一】基本知识与Linux的安装

    一.操作系统基本常识 1.操作系统的定义:操作系统是用来协调.管理和控制计算机硬件与软件资源的系统程序,介于硬件与应用程序之间. 2.操作系统内核的定义:操作系统内核是一个管理和控制程序,负责管理计算 ...

  10. 【Linux】linux 机器之间 zssh, rz, sz互相传输

    服务器端安装lrzsz: sudo  yum install lrzsz 本地客户端安装lrzsz: brew install lrzsz 本地客户端安装zssh: brew install zssh ...