Database Reference
In-Depth Information
Database
with Changes
Undo
Database
Without Changes
Before Images
(a) Rollback
Database
Without Changes
(Save)
Redo
Database
with Changes
After Images
Figure 9-17
Undo and redo transactions
(b) Rollforward
When all of the before images have been restored, the transaction is undone. To redo a
transaction, the recovery processor starts with the version of the database at the time the
transaction started and applies all of the after images. As stated, this action assumes that an
earlier version of the database is available from a database save.
Restoring a database to its most recent save and reapplying all transactions may require
considerable processing. To reduce the delay, DBMS products sometimes use checkpoints.
A checkpoint is a point of synchronization between the database and the transaction log.
To perform a checkpoint, the DBMS refuses new requests, finishes processing outstanding
Figure 9-18
Example transaction Log
START
MODIFY
START
MODIFY
INSERT
START
COMMIT
COMMIT
MODIFY
COMMIT
1
2
3
4
5
6
7
8
9
10
OT1
OT1
OT2
OT1
OT1
CT1
OT1
OT2
CT1
CT1
0
1
0
2
4
0
5
3
6
9
2
4
8
5
7
9
0
0
10
0
11:42
11:43
11:46
11:47
11:47
11:48
11:49
11:50
11:51
11:51
(old value)
(new value)
CUST 100
(old value)
(new value)
(value)
SP AA
ORDER 11
(old value)
(new value)
SP BB
 
 
Search WWH ::




Custom Search