|
物理坏块与逻辑坏块(Physical and Logical Block Corruptions) |
坏块被分为物理坏块和逻辑坏块
(一) 物理坏块
物理坏块通常会报ORA-1578错误,并在alert.log中记录详细信息
常见的形式如下:
- Bad header - the beginning of the block (cache header) is corrupt with invalid values
- The block is Fractured/Incomplete - header and footer of the block do not match
- The block checksum is invalid
- The block is misplaced
- Zeroed out blocks
详细描述如下:
1) Fractured Block
表明block的头部和尾部不匹配,证明该block的信息是不完整的,trace包含如下信息
Corrupt block
relative dba: 0x0380e573 (file 14, block 58739)
Fractured block found during buffer read
Data in bad block -
type: 6 format: 2 rdba: 0x0380e573
last change scn: 0x0288.8e5a2f78 seq: 0x1 flg: 0x04
consistency value in tail: 0x00780601
check value in block header: 0x8739, computed block checksum: 0x2f00
spare1: 0x0, spare2: 0x0, spare3: 0x0
***
Reread of rdba: 0x0380e573 (file 14, block 58739) found same corrupted data
2) Bad Checksum
Block 在写入的时候会进行block的Checksums(该功能由参数db_block_checksum控制 默认为true) 并把效验值记入block头部,每次block由硬盘读入内存的的时候,oracle计算block效验值是否和block的头部的信息是否一致。
Corrupt block
relative dba: 0x0380a58f (file 14, block 42383)
Bad check value found during buffer read
Data in bad block -
type: 6 format: 2 rdba: 0x0380a58f
last change scn: 0x0288.7784c5ee seq: 0x1 flg: 0x06
consistency value in tail: 0xc5ee0601
check value in block header: 0x68a7, computed block checksum: 0x2f00
spare1: 0x0, spare2: 0x0, spare3: 0x0
***
Reread of rdba: 0x0380a58f (file 14, block 42383) found same corrupted data
A value different than zero (0x0) in "computed block checksum" means
that the checksum differs and the result of this comparison is printed.
3) Block Misplaced
Checksum有效但是block的内容属于其他block,trace 包含如下信息
Corrupt block
relative dba: 0x0d805a89 (file 54, block 23177)
Bad header found during buffer read
Data in bad block -
type: 6 format: 2 rdba: 0x0d805b08 ----> Block is
different than expected 0x0d805a89
last change scn: 0x0692.86dc08e3 seq: 0x1 flg: 0x04
consistency value in tail: 0x08e30601
check value in block header: 0x2a6e, computed block checksum: 0x0
spare1: 0x0, spare2: 0x0, spare3: 0x0
***
(二) 逻辑坏块
Checksum有效,但是block内容不一致,通常引起ORA-600错误
如: ORA-00600
[13013], [5001] (Doc ID 816784.1)
逻辑坏块常见形式:
- row locked by non-existent transaction - ORA-600 [4512], etc
- the amount of space used is not equal to block size
- avsp bad
- etc.
当db_block_checking设置为true时,会报如下错误
ORA-600 [kddummy_blkchk] or ORA-600 [kdBlkCheckError].如果磁盘上的block已经有逻辑坏块,该block下次被更新的时候,将被标记为Soft Corrupt 将来被读的时候报ORA-1578, DBVerify将报错误"DBV-200: Block, dba , already marked corrupted".
效验工具
1) RMAN方式
数据库
backup validate database;--不加check logical选项仅检测物理坏块
backup check logical validate database;
坏块信息记录到V$DATABASE_BLOCK_CORRUPTION
数据库+归档日志
BACKUP VALIDATE DATABASE ARCHIVELOG ALL
BACKUP VALIDATE CHECK LOGICAL DATABASE ARCHIVELOG ALL;
针对备份文件
RESTORE DATABASE VALIDATE;
RESTORE ARCHIVELOG ALL VALIDATE;
坏块恢复恢复
BLOCKRECOVER DATAFILE 3 BLOCK 121;
BLOCKRECOVER CORRUPTION LIST; 恢复V$DATABASE_BLOCK_CORRUPTION中所有坏块
2) DBVerify 方式
默认检测物理和逻辑坏块
dbv file= blocksize=
3) ANALYZE .. VALIDATE STRUCTURE方式
analyze table
4) DBMS_REPAIR 方式
发现、标识并修改数据文件中的坏块,但使用这个包的同时会带来数据丢失、表和索引返回数据不一致,完整性约束破坏等其他问题,因此,dbms_repair只是在没有备份的情况下使用的一种手段,这种方式一般都会造成数据的丢失,dbms_repair包的工作原理比较简单,是将检查到的坏块标注出来,使随后的dml操作跳过该块
详细操作:参考
http://docs.oracle.com/cd/B19306_01/server.102/b14231/repair.htm#i1006373
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15747463/viewspace-1062378/,如需转载,请注明出处,否则将追究法律责任。
<%=items[i].content%>
<%if(items[i].items.items.length) { %><%=items[i].items.items[j].username%> 回复 <%=items[i].items.items[j].tousername%>: <%=items[i].items.items[j].content%>
最新文章
- 【kylin】Failed to build cube
- Greenplum 数据分布黄金法则 - 论分布列与分区的选择
- oracle 11g_调度程序维护任务或 Autotasks
- How to Find which Session is Holding a Particular Library Cache Lock
- 修改系统时间对oracle数据库的影响
- oracle控制文件复制、移动方式
- How To Move Datafiles On AIX Using Raw Logical Volumes To A New Location?
- ASMM/AMM开启时动态调整内存组件(shared_pool_size, db_cache_size等)大小
- RAC中通过nkmod解决各个节点盘符不一致问题
- full backup 与 level 0 incremental backup
转载于:http://blog.itpub.net/15747463/viewspace-1062378/