If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > log writes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-30-11, 19:38
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
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?
Reply With Quote
  #2 (permalink)  
Old 05-30-11, 20:25
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Or the process of writing a log record to log buffer in LUW is considered the same as "asynchronous log writes" in zOS?
Reply With Quote
  #3 (permalink)  
Old 06-01-11, 03:57
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On