Finish Concurrency, Logging and Recovery




CS185c

Chris Pollett

Apr 29, 2010

Outline

Introduction

Parameters that affect locking

DB2 Serialization Mechanisms

DB2 has several serialization mechanisms...

Latches

Claim and Drain

Claims

Drains

Logging and Recovery

DB2 Memory Structure and Deferred Write

Risks of System Failure

Logging as a Remedy for System Failure

Master Copy of Data

Categories of Log Information

DB2 makes use of several different kinds of log records:

Logging Process Overview

A diagram showing active and archive logs

Unit of Recovery Logs

In the event of a failure, logs are used in the following way to get the database back into a consistent state:

Unit of recovery records are either undo/redo records, or control records of the form begin UR, end UR, ABORT, etc.

Recall a unit of recovery is a DB2 mechanism to track the progress of a transaction as it updates the database

It begins with the first change to the data after the beginning of the job, or after the last point of consistency

It ends at a later point of consistency

Undo Logs

Redo Logs

Recovery with Logs

Unit of Recovery Control Records

UR records will allow us to know when a transaction began or ended. They come in the following flavors:

Compensation Logs

Checkpoints