Information Technology Reference
In-Depth Information
database disk
log disk
n 1
n 2
n 3
n 4
n 5
update on
q
p
Page -LSN=
page
q
Page -LSN=
page
update on
p
n 2
n 1
checkpoint
update on
p
commit
fix page
flush page
flush
log
n 6
n 7
n 8
n 9
update on q
page
p
Page -LSN=
page
q
Page -LSN=
update on
p
n 9
n 8
update on
q
update on
p
database buffer
log buffer
Fig. 2.3
Database state after a sequence of logged actions
checkpoint ,ora fuzzy checkpoint , in which only some of the modified pages are
flushed. In a minimalistic fuzzy checkpoint, no database pages are flushed, but
only some information about currently buffered pages are written to the log. This
information includes page identifiers with LSN s indicating positions in the log after
which there might be updates that are missing from the disk versions of pages;
in restart recovery, this information is used to determine those pages whose disk
versions might have some updates missing (see Chap. 4 ).
Example 2.3 Figure 2.3 shows the states of two pages after a sequence of actions
logged with LSN s n 1 to n 9 . The updates up to LSN n 2 are present in the disk versions
of pages p and q because the pages have been flushed from the buffer onto disk when
taking the checkpoint logged with LSN n 3 . Before the pages were flushed, following
the write-ahead logging protocol, the log up to n 2 was flushed from the log buffer
onto the log disk. Next time the log was flushed when a transaction was committed
at LSN n 5 . After that, active transactions updated pages p and q, generating the log
records with LSN s n 6 to n 9 appended to the log buffer.
The current versions of pages p and q are in the database buffer. The P AGE -
LSN values stamped in the page headers indicate that the current version of page p
contains all the updates logged with LSN s n 2 , n 4 , n 7 ,andn 9 , while the disk version
of p does not contain the three last updates, and that the current version of page q
 
Search WWH ::




Custom Search