Tuesday, November 20, 2012

Block Corruption in Oracle Database


Oracle classifies the Data File Block corruptions as Physical and Logical :

Physical Block Corruptions

This kind of block corruptions are normally reported by Oracle with error ORA-1578 and the detailed corruption description is printed in the alert log.

Corruption Examples are:

    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 / ORA-8103

Detailed Corruption Description:

Fractured Block:
A Fractured block means that the block is incomplete. Information from the block header does not match the block tail.

Bad Checksum:
Block Checksums are used to identify if the block was changed by something external to Oracle and after the block was last written by Oracle.
Checksum is calculated by DBWR or direct loader before writing the block to disk and stored in the block header. Every time that the block is read and if db_block_checksum is different than false, Oracle calculates a checksum and compares it to the one stored in the block header. Reference Note 30706.1

Block Misplaced:
This is when Oracle detected that the content of the block being read belongs to a different block and the checksum is valid


********************************************************************************

Logical Block Corruptions

This is when block contains a valid checksum and the structure below the beginning of the block is corrupt (Block content is corrupt). It may cause different ORA-600 errors.

The detailed corruption description for Logical Corruptions are not normally printed in the alert.log. DBVerify will report what is logically corrupted in the block.

Corruption Examples are:

    row locked by non-existent transaction - ORA-600 [4512],etc
     the amount of space used is not equal to block size
    avsp bad
    etc.

When db_block_checking is enabled, it may produce the internal errors ORA-600 [kddummy_blkchk] or ORA-600 [kdBlkCheckError].


If db_block_checking is enabled and the block is already logically corrupt on disk, the next block update will mark the block as Soft Corrupt and future reads of this block will produce the error ORA-1578. In that case DBVerify reports this corruption with error "DBV-200: Block, dba <rdba>, already marked corrupted".

No comments:

Post a Comment