IBM 5655-DB2 Server User Manual


 
112 Storage Management with DB2 for OS/390
10.4.1 Asynchronous Writes
DB2 writes the log records (the control intervals) from the output buffer to the
active log data set when the number of log buffers used reaches the value the
installation set for the WRITE THRESHOLD field of installation panel DSNTIPL;
see Figure 40 on page 115. The application is not aware of these writes.
10.4.2 Synchronous Writes
Synchronous writes usually occur at commit time when an application has
updated data. This write is called
forcing the log, because the application must
wait for DB2 to write the log buffers to disk before control is returned to the
application. If the log data set is not busy, all log buffers are written to disk. If the
log data set is busy, the requests are queued until it is freed.
10.4.3 Writing to Two Logs
If there are two logs (recommended for availability), the write to the first log, in
general, must complete before the write to the second log begins. The first time a
log control interval is written to disk, the write I/Os to the log data sets are done in
parallel. However, if the same 4 KB log control interval is again written to disk,
then the write I/Os to the log data sets must be done serially to prevent any
possibility of losing log data in case of I/O errors occurring on both copies
simultaneously. This method improves system integrity. I/O overlap in dual
logging occurs whenever multiple log control intervals have to be written; for
example, when the WRITE THRESHOLD value is reached, or when log records
accumulate because of a log device busy condition
10.4.4 Two-Phase Commit Log Writes
IMS applications with DB2, and CICS and RRS applications with additional
resources besides DB2 to manage, use two-phase commit protocol. Because
they use two-phase commit, these applications force writes to the log twice, as
shown in Figure 38 on page 113. The first write forces all the log records of
changes to be written (if they have not been written previously because of the
write threshold being reached). The second write writes a log record that takes
the unit of recovery into an in-commit state.