Results 1 to 3 of 3

Thread: log writes

  1. #1
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,369

    Unanswered: log writes

    zOS:

    --------------------------------------------------------------------------
    Log writes are divided into two categories: asynchronous and synchronous.

    Asynchronous writes
    Asynchronous writes are the most common. These asynchronous writes occur when data is updated. Before, and after, image records are usually moved to the log output buffer, and control is returned to the application. However, if no log buffer is available, the application must wait for one to become available.

    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 force 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.

    IBM Information Management Software for z/OS Solutions Information Center
    --------------------------------------------------------------------------



    LUW:

    --------------------------------------------------------------------------
    All changes to regular data and index pages are written to the log buffer before being written to disk by the logger process. SQL statement processing must wait for log data to be written to disk:

    - On COMMIT
    - Until the corresponding data pages are written to disk, because the DB2 server uses write-ahead logging, in which not all of the changed data and index pages need to be written to disk when a transaction completes with a COMMIT statement
    - Until changes (mostly resulting from the execution of data definition language statements) are made to the metadata
    - When the log buffer is full

    IBM DB2 9.7 for Linux, UNIX and Windows Information Center
    --------------------------------------------------------------------------




    LUW uses write ahead logging. I think zOS is the same.


    In LUW, all log writes are synchronous. The application much wait for the log record to be on disk before commit is successful and control is returned to the application. Increasing mincommit will not make log writes asynchronous.


    Do you know why LUW is different from zOS - why LUW does not do asynchronous log writing?

  2. #2
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,369
    Or the process of writing a log record to log buffer in LUW is considered the same as "asynchronous log writes" in zOS?

  3. #3
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Both are pretty much the same: it has to be guaranteed that committed transactions are in the log. Therefore, a COMMIT requires a synchronous write. Everything else can be done in buffers or asynchronously because it wouldn't be critical if those log records get lost - the transaction hasn't committed yet anyway.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •