当前位置:  数据库>oracle

ORA-01578 ORA-01110 坏块解决方法

    来源: 互联网  发布时间:2017-05-30

    本文导语: 一个案例,查看跟踪文件发现如下错误信息   d:Oracleproduct10.2.0admindbserverudumporcl_ora_5888.trc Bad header found during buffer read Data in bad block: type: 1 format: 5 rdba: 0x30322d2d last change scn: 0xfffe.fffefffe seq: 0xfe flg: 0xff spare1: 0x0 spare2: 0x30 spare3: 0x0 con...

一个案例,查看跟踪文件发现如下错误信息

 

d:Oracleproduct10.2.0admindbserverudumporcl_ora_5888.trc

Bad header found during buffer read

Data in bad block:

type: 1 format: 5 rdba: 0x30322d2d

last change scn: 0xfffe.fffefffe seq: 0xfe flg: 0xff

spare1: 0x0 spare2: 0x30 spare3: 0x0

consistency value in tail: 0x2d2d3533

check value in block header: 0xfffe

computed block checksum: 0x91f9

Reread of rdba: 0x09848269 (file 38, block 295529) found same corrupted data

Fri Dec 27 08:28:08 2013

Corrupt Block Found

TSN = 36, TSNAME = HGHIS

RFN = 38, BLK = 295529, RDBA = 159679081

Fri Dec 27 08:54:18 2013

Hex dump of (file 38, block 295561) in trace file d:oracleproduct10.2.0admindbserverudumporcl_ora_6796.trc

Bad header found during buffer read

Data in bad block:

type: 48 format: 0 rdba: 0x020cc100

last change scn: 0xb500.080cc100 seq: 0xa5 flg: 0xba

spare1: 0x34 spare2: 0x2 spare3: 0xb0b8

consistency value in tail: 0x395e3031

check value in block header: 0xcfcb

block checksum disabled

Reread of rdba: 0x09848289 (file 38, block 295561) found same corrupted data

Fri Dec 27 08:54:19 2013

Corrupt Block Found

TSN = 36, TSNAME = HGHIS

RFN = 38, BLK = 295561, RDBA = 159679113

Fri Dec 27 09:11:20 2013

Hex dump of (file 38, block 295563) in trace file d:oracleproduct10.2.0admindbserverudumporcl_ora_5584.trc

Bad header found during buffer read

Data in bad block:

type: 71 format: 7 rdba: 0x064d0001

last change scn: 0x3038.43584400 seq: 0x31 flg: 0x07

spare1: 0x44 spare2: 0x4c spare3: 0x771

consistency value in tail: 0x000a0000

check value in block header: 0x7800

computed block checksum: 0xcbf8

Reread of rdba: 0x0984828b (file 38, block 295563) found same corrupted data

Fri Dec 27 09:11:21 2013

Corrupt Block Found

TSN = 36, TSNAME = HGHIS

RFN = 38, BLK = 295563, RDBA = 159679115

Fri Dec 27 09:27:59 2013

 

 

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

DBV FILE="d:oradataDATA.DBF" blocksize=8192

or

rman target /

backup validate check logical database;

select * from V$DATABASE_BLOCK_CORRUPTION ;

 

 

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

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

38是文件号,295529是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 = 38 and 295563 between block_id and block_id + blocks - 1;

输出如下

owner=HGHIS
segment_name=SYS_LOB0000119493C00006$$
segment_type=LOBSEGMENT

找到表明和LOB字段

select table_name, column_name from dba_lobs where segment_name = 'SYS_LOB0000119493C00006$$' and owner = 'HGHIS';

输出如下

table_name = EMR_CASE
column_name = WORD

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

create table bad_rows (row_id ROWID,oracle_error_code number);

set concat off
set serveroutput on


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('889911')) ;
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: WORD
Enter value for table_owner: HGHIS
Enter value for table_with_lob: EMR_CASE
可以查询bad rowid
select * from bad_rows;

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

set concat off
update &table_owner.&table_with_lob set &lob_column = empty_blob() 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

 

相关阅读:

Oracle ORA-01555 快照过旧 说明

ORA-01078 和 LRM-00109 报错解决方法

ORA-01555超长的Query Duration时间

ORA-00471 处理方法笔记

ORA-00314,redolog 损坏,或丢失处理方法

ORA-00257 归档日志过大导致无法存储的解决办法


    
 
 

您可能感兴趣的文章:

  • oracle ORA-01114、ORA-27067错误解决方法
  • Orcle的package中访问其它Schema的表报错ORA-00942解决方法
  • oracle远程连接服务器出现 ORA-12170 TNS:连接超时 解决办法
  • 解决报错ora-32035的方法分析
  • ORA-12514及ORA-28547错误解决方案
  • 基于ORA-12170 TNS 连接超时解决办法详解
  • 安装oracle出现error:ora-01031:insufficient privilleges的解决
  • plsql连接oracle数据库报ora 12154错误解决方法
  • zilong28提问:Tomcat3.2报错内容是Error occurs when connecting DB: ORA-00020: maximum number of processes(59) exceeded 我应该如何解决,先谢了
  • ORA-28002 Oracle 11g存在密码过期问题解决方案
  • Linux 下数据库oracle出现ORA-27102错误的解决办法
  • Oracle ORA-22908(NULL表值的参考)异常分析与解决方法
  • PHP连接Oracle错误ORA-24324服务句柄未初始化的解决方法
  • ORACLE出现错误1033和错误ORA-00600的解决方法
  • 如何解决ORA-01843与NLS_DATE_FORMAT问题
  • oracle 11g导出数据时报ORA 1455错误的处理方法
  •  
    本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
    本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • 出现ORA-01401和ORA-01008错误?
  • Eclipse连接Oracle数据库的ORA-00604 ORA-12705错误
  • Oracle不能删除表 ORA-00604 ORA-01422 错误
  • 如何得到带有ora的行的下一行
  • 如何配置 linux 下 oracle 的 listener .ora 和
  • 浅析如何在tnsnames.ora中配置监听
  • ORA-28002 Oracle 11g存在密码过期问题解决方案 iis7站长之家
  • aq.executeQuery: ORA-00020: maximum number of processes (59) exceeded
  • Oracle 数据库闪回功能设置出现ORA-19809和ORA-19804错误
  • ORA-00947:Not enough values (没有足够的值)的深入分析
  • solaris10 安装 ora9.2.0.1 时报错
  • 在UNIX下,我的ORA817该怎么样才可以自己启动呀?
  • 谁能帮忙解释一下: ORA-01000 : maximun open cursors exceeded
  • 关于Oracle游标的问题(ORA-01000: maximum open cursors exceeded)
  • 我在Linux7。3下面装了一个Oracle8i,但是现在启动不起来了,总是报错ORA-01031: insufficient privileges
  • oracle报错(ORA-00600)问题处理
  • 为什么我读取数据库时出现:ORA-00600: 内部错误代码,参数: [ttcgcshnd-1], [0], [],错误?
  • Oracle 10g之ORA-32004问题
  • 在客户端配置TNS测试报错ORA-12170:TNS:连接超时


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,