The first page of the file starts with a 668-byte header, and the second page holds an identical copy. The rest of each page is zeros. The header says what the file is, how large its pages are, whether it was closed cleanly and where in the transaction log it stands. All numbers are little-endian.
What a reader takes from it
| Need | Field |
|---|---|
| Is it an ESE database? | The four bytes EF CD AB 89 at offset 4, and a page size that is 2, 4, 8, 16 or 32 KiB. |
| Where is page n? | At byte (n + 1) × page size. Pages 0 and 1 of the file are this header and its copy. |
| How are pages and records laid out? | The format revision and the page size: pages of 16 KiB and more have an 80-byte header. |
| Is the file complete? | The database state: 3 is a clean shutdown, 2 a dirty one (changes in the log files are missing). |
| Is the header intact? | The checksum at offset 0, and the shadow header, which should equal it. |
Fields
| Offset | Size | Name | Description |
|---|---|---|---|
| 0 | 4 | Checksum | XOR of the 32-bit words from offset 4 to the end of the 668 bytes, starting from 0x89abcdef. (Checked on six real files.) |
| 4 | 4 | Signature | EF CD AB 89, the number 0x89abcdef. |
| 8 | 4 | Format version | 0x620. |
| 12 | 4 | File type | 0 database, 1 streaming file (.stm). |
| 16 | 8 | Database time | A counter that grows with every change; each page copies it as its last-modified time. |
| 24 | 28 | Database signature | A random number (4 bytes), the creation time (8 bytes, a log time) and the computer name (16 bytes). |
| 52 | 4 | Database state | 1 just created, 2 dirty shutdown, 3 clean shutdown, 4 being converted, 5 force detach. |
| 56 | 8 | Consistent position | A log position (below). |
| 64 | 8 | Consistent date and time | A log time (below). |
| 72 | 8 | Attach date and time | A log time. |
| 80 | 8 | Attach position | A log position. |
| 88 | 8 | Detach date and time | A log time. |
| 96 | 8 | Detach position | A log position. |
| 104 | 4 | Database ID | Not documented. |
| 108 | 28 | Log signature | The signature of the log the database belongs to, in the same layout as the database signature. |
| 136 | 24 | Previous full backup | Backup information (below). |
| 160 | 24 | Previous incremental backup | Backup information. |
| 184 | 24 | Current full backup | Backup information. |
| 208 | 4 | Shadowing disabled | Non-zero when the shadow copies of the header and the catalog are off. |
| 212 | 4 | Last object identifier | The highest identifier given to a table, index or long value tree. |
| 216 | 16 | Index update version | Four 32-bit numbers: the Windows major version, minor version, build number and service pack the indexes were last updated for. |
| 232 | 4 | File format revision | The revision of the format; see the versions. |
| 236 | 4 | Page size | 2048, 4096, 8192, 16384 or 32768. |
| 240 | 4 | Repair count | How many times the database was repaired. |
| 244 | 8 | Repair date and time | A log time. |
| 252 | 28 | Repair information | Not documented. |
| 280 | 8 | Scrub database time | The database time the last scrub started at. |
| 288 | 8 | Scrub date and time | A log time. |
| 296 | 8 | Required log | The oldest log generation recovery needs. |
| 304 | 12 | Upgrade fields | Three 32-bit numbers about an upgrade from the Exchange 5.5 format: the format flag, the free pages and the space map pages. |
| 316 | 24 | Current shadow copy backup | Backup information. |
| 340 | 4 | Creation file format version | The format version of the engine that created the database. |
| 344 | 4 | Creation file format revision | The revision of the engine that created the database. |
| 348 | 16 | Unknown | Not documented. |
| 364 | 4 | Old repair count | |
| 368 | 4 | ECC fix success count | Pages whose ECC checksum corrected a single-bit error. |
| 372 | 8 | Last ECC fix success time | A log time. |
| 380 | 4 | Old ECC fix success count | |
| 384 | 4 | ECC fix error count | Pages whose ECC could not correct them. |
| 388 | 8 | Last ECC fix error time | A log time. |
| 396 | 4 | Old ECC fix error count | |
| 400 | 4 | Bad checksum error count | Pages that failed their checksum when they were read. |
| 404 | 8 | Last bad checksum error time | A log time. |
| 412 | 4 | Old bad checksum error count | |
| 416 | 4 | Committed log | The newest log generation whose changes are in the database. |
| 420 | 24 | Previous shadow copy backup | Backup information. |
| 444 | 24 | Previous differential backup | Backup information. |
| 468 | 40 | Unknown | Zeros in the files described. |
| 508 | 8 | NLS version | The major and minor version (two 32-bit numbers) of the string comparison tables the indexes were built with. |
| 516 | 148 | Unknown | Zeros in the files described. |
| 664 | 4 | Unknown flags | Not documented. |
Log times, log positions, backup information and signatures
- Log time (8 bytes): seconds, minutes, hours, day, month and the year minus 1900, one byte each, then two bytes that are not documented (in backup times the low bit of the last one tells a streaming backup from a snapshot). All zero means not set.
- Log position (8 bytes): the byte offset within the sector (16 bits), the sector (16 bits) and the log generation (32 bits), the number in the log file's name.
- Backup information (24 bytes): a log position (8), a log time (8), the lower log generation (4) and the upper log generation (4).
- Signature (28 bytes): a random number (4), a log time (8) and the computer's name in ASCII (16).
The streaming file
An older Exchange database has a companion streaming file, .stm. It has the same header with the file type 1. The pages after the two header pages hold raw stream data; their layout is not described anywhere this page can cite, so the explorer shows them as bytes.
Links
Reference
- Extensible Storage Engine (ESE) Database File (EDB) format – the offsets and names of the header