Subject: QREF: Physical Oracle7 Data Block Layout Creation Date: 04-NOV-1996 Physical Oracle Data Block Layout ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is a quick outline of the physical layout of an Oracle datafile block. It does not apply to online redo blocks or controlfiles. The physical data block size is determined by the init.ora set at database creation. Each formatted data block on disk has a block wrapper to identify it. This consists of a 20 byte header and a 4 byte trailer as below. Unformatted blocks are completely ZERO throughout. | | | | | | | | | | | | | | | | | | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |10 |11 |12 |13 |14 |15 | +-------+-------+---------------+---------------+---------------+ |Typ|Ver|Filler | DBA | Incarnation | Sequence | |-------+-------+---------------+---------------+---------------| |ChkSum |Filler |<------ | |-------+-------+ | : Body of : : Data Block : : [NOTE:33188.1] : | +---------------| | --------->| IncSeq | +---------------------------------------------------------------+ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | | | | | | | | | | | | | | | | | | The bytes in the header are defined as: Typ Block Type (defined in k.h). For a full list see [NOTE:33188.1] Ver Block version. In Oracle6 and 7 this is 0x01. 0x02 indicates and Oracle8 format block Filler Not used at present DBA Database address of the block. See [NOTE:33311.1] Use 'odba' to decode a DBA. See [NOTE:30322.1] Inc Incarnation of the block. Is incremented each time the block is 'newed'. Seq Sequence number of the block. A change version for the current incarnation. IncSeq Lower order 2 bytes of Incarnation plus lower 2 order bytes of the Sequence number. This is used to help detect split blocks where the tail of the block may be from a different version of the block to the header. ChkSum This is a simple checksum on the contents of the block. It uses the routine smschk() and is only present: a) always for file header blocks or b) if is set. What is a Soft Corrupt Block ? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A soft corrupt block is defined as an Oracle data block which has the Seq set to ZERO. The 'IncSeq' at the tail of the block is set to match the block header as normal. This special condition is used by special block-checking code to mark a block as corrupt from an Oracle viewpoint. Subsequent attempts to access the block will result in ORA-01578 (unless is used with a full table scan). This special block checking is performed: a) By PMON b) By any Oracle process if any of the events below are set: Data Blocks Index Blocks Cluster Blocks Search Words ~~~~~~~~~~~~ ORA-1578