数据库 基于日志的恢复技术
Introduction
介绍
A log is the most widely used recording database modification technique. The log is a structure used for recording database modification. It is a sequence of log record recording all the update activities in the database. We can use this log to recover from failure and to bring back the database to the consistent state. An update log record contains various fields:
日志是最广泛使用的记录数据库修改技术。 日志是用于记录数据库修改的结构。 它是一系列日志记录,记录了数据库中的所有更新活动。 我们可以使用此日志从故障中恢复并使数据库恢复到一致状态。 更新日志记录包含多个字段:
Transaction identifier: It is the identifier which uniquely identifies the transaction.
交易标识符:是唯一标识交易的标识符。
Data item identifier: It is the identifier which uniquely identifies the data to be used.
数据项标识符:是唯一标识要使用的数据的标识符。
Old value: It is the value of the data item before the write operation.
旧值:这是写操作之前数据项的值。
New value: It is the value of the data item after performing the write operation.
新值:是执行写操作后数据项的值。
There are many types of log record we denote the various types of log records:
日志记录有很多类型,我们表示各种类型的日志记录:
- <Ti start> transaction Ti has started.
- <Ti, Xi, V1, V2> transaction Ti has performed a write on data item Xi, Xj has value v1 before the write and will have value V2 after the write operation.
- <Ti commit> transaction Ti has committed.
- <Ti abort> transaction Ti ha aborted.
Whenever a transaction performs write operation database is modified only when log record for that write is created. And logs may or may not contain the reco