In computer science, in the field of databases, a Database Log is a history of actions executed by a database management system. Physically, a log is a file of records stored in stable storage, designed to withstand crashes.

Table of contents
1 Anatomy of a General Database Log
2 Types of Database Logs Records
3 Tables

Anatomy of a General Database Log

A database log record is made up of (FIXME: resource managers, xid not universal)

Types of Database Logs Records

All log records include the general log attributes above, and also other attributes depending on their type (which is recorded in the Type attribute, as above).

Tables

These tables are maintained in memory, and can be efficiently reconstructed (if not exactly, to an equivalent state) from the log and the database:

  • Transaction Table: The table contains one entry for each active transaction. This includes Transaction ID, and lastLSN, where lastLSN describes the LSN of the most recent log record for the transaction.

  • Dirty Page Table: The table contains one entry for each dirty page that haven't been written to disk. The entry contains recLSN, where recLSN is the LSN of the first log record that caused the page to be dirty.


  • TODO: Log Iteration and Interactions