IBM 000-8697 Manual Do Utilizador

Página de 702
System Architecture
2-63
Physical Log Buffer
If the user process intends to modify the buffer, it acquires a latch on the
buffer and changes the buffer lock-access type to exclusive.
A copy of the “before-image” of the page is needed for data consistency. The
user process determines if a “before-image” of this page was written to either
the physical log buffer or the physical log since the last checkpoint. If not, a
copy of the page is written to the physical log buffer.
The data in the page buffer is modified, including the timestamps on the
page. When the modification is complete, the latch on the buffer is released.
If any transaction records are required for logging, those records are written
to the logical log buffer.
After the latch on the buffer is released, the user process is ready to release
the buffer. First, the releasing user process acquires a latch on the buffer table
that enables it to modify the buffer entry.
The releasing process updates the timestamp in the buffer header so that the
timestamp on the buffer page and the timestamp in the header match.
Statistics describing the number and types of writes performed by this user
process are updated.
The lock is released as described in the previous section, but the buffer is
appended to the
MLRU
queue associated with its original queue set. (Refer to
). If the latch for that
MLRU
 queue is unavailable, the process tries
to acquire a latch for a randomly selected
 MLRU
 queue. When the
MLRU
queue latch is acquired, the modified buffer is linked to the “most-recently
used” end of the queue.
Physical Log Buffer
OnLine uses the shared-memory physical log buffer as temporary storage of
“before-images” of disk pages. Before a disk page can be modified, a “before-
image” of the page on disk must already be stored in the physical log on disk
or one must be written to the physical log buffer. In the latter case, the
physical log buffer must be flushed to disk before the modified page can be
flushed to disk. Writing the “before-image” to the physical log buffer and
then flushing the buffer page to disk is illustrated in
.
Both the physical log buffer and the physical log maintain the physical and
logical consistency of OnLine data.