Firebird Documentation IndexInside a Firebird Database → Standard Database Page Header
Firebird Home Firebird Home Prev: Database StructureFirebird Documentation IndexUp: Inside a Firebird DatabaseNext: Database Header Page - Type 0x01

Standard Database Page Header

Every page in a database has a 16 byte standard page header. Various page types have an additional header that follows on from the standard one. The C code representation of the standard header is:

struct pag
{
    SCHAR pag_type;
    UCHAR pag_flags;
    USHORT pag_checksum;
    ULONG pag_generation;
    ULONG pag_scn;
    ULONG reserved;
};

Pag_type: One byte, signed. Byte 0x00 on the page. This byte defines the page type for the page. Valid page types are:

Pag_flags: One byte, unsigned. Byte 0x01 on the page. This byte holds various flags for the page.

Pag_checksum: Two bytes, unsigned. Bytes 0x02 - 0x03. Checksum for the whole page. No longer used, always 12345, 0x3039. Databases using ODS8 on Windows NT do have a valid checksum here.

Note

Discussions are underway on the development mailing list on reusing this field as a page number rather than a checksum. From Firebird 3.0, it is possible that this field in the page header will probably have a new name and function.

Pag_generation: Four bytes, unsigned. Bytes 0x04 - 0x07. The page generation number. Increments each time the page is written back to disc.

Pag_scn: Four bytes, unsigned. Bytes 0x08 - 0x0b. Originally used as the sequence number in the Write Ahead Log, but WAL is no longer used. The field was converted to be the SCN number to avoid an ODS change and is now used by nbackup.

Pag_reserved: Four bytes, unsigned. Bytes 0x0c - 0x0f. Reserved for future use. It was originally used for the offset of a page's entry in the Write Ahead Log (WAL), but this is no longer in use.

Prev: Database StructureFirebird Documentation IndexUp: Inside a Firebird DatabaseNext: Database Header Page - Type 0x01
Firebird Documentation IndexInside a Firebird Database → Standard Database Page Header