Transaction Log - Types of Database Log Records

Types of Database Log 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).

  • Update Log Record notes an update (change) to the database. It includes this extra information:
    • PageID: A reference to the Page ID of the modified page.
    • Length and Offset: Length in bytes and offset of the page are usually included.
    • Before and After Images: Includes the value of the bytes of page before and after the page change. Some databases may have logs which include one or both images.
  • Compensation Log Record notes the rollback of a particular change to the database. Each correspond with exactly one other Update Log Record (although the corresponding update log record is not typically stored in the Compensation Log Record). It includes this extra information:
    • undoNextLSN: This field contains the LSN of the next log record that is to be undone for transaction that wrote the last Update Log.
  • Commit Record notes a decision to commit a transaction.
  • Abort Record notes a decision to abort and hence roll back a transaction.
  • Checkpoint Record notes that a checkpoint has been made. These are used to speed up recovery. They record information that eliminates the need to read a long way into the log's past. This varies according to checkpoint algorithm. If all dirty pages are flushed while creating the checkpoint (as in PostgreSQL), it might contain:
    • redoLSN: This is a reference to the first log record that corresponds to a dirty page. i.e. the first update that wasn't flushed at checkpoint time. This is where redo must begin on recovery.
    • undoLSN: This is a reference to the oldest log record of the oldest in-progress transaction. This is the oldest log record needed to undo all in-progress transactions.
  • Completion Record notes that all work has been done for this particular transaction. (It has been fully committed or aborted)

Read more about this topic:  Transaction Log

Famous quotes containing the words types of, types, log and/or records:

    Science is intimately integrated with the whole social structure and cultural tradition. They mutually support one other—only in certain types of society can science flourish, and conversely without a continuous and healthy development and application of science such a society cannot function properly.
    Talcott Parsons (1902–1979)

    He’s one of those know-it-all types that, if you flatter the wig off him, he chatter like a goony bird at mating time.
    —Michael Blankfort. Lewis Milestone. Johnson (Reginald Gardner)

    This state is full of these log cabin Abe Lincolns with price tags on ‘em. The louder he yells, the higher his price.
    Robert Rossen (1908–1966)

    Philosophy, astronomy, and politics were marked at zero, I remember. Botany variable, geology profound as regards the mud stains from any region within fifty miles of town, chemistry eccentric, anatomy unsystematic, sensational literature and crime records unique, violin player, boxer, swordsman, lawyer, and self-poisoner by cocaine and tobacco.
    Sir Arthur Conan Doyle (1859–1930)