How Db2 writes from the group buffer pool to disk

The process of writing pages from the group buffer pool to disk is called castout.

Because no physical connection exists between the group buffer pool and disk, the castout process involves reading the page from the group buffer pool into a particular member's private buffer (not part of the buffer pool storage), and then writing the page from the private buffer to disk. This member is the owner of the castout process for the page set or partition. The first member with update intent on the page set or partition is assigned ownership of castout. After castout ownership is assigned, subsequent updating members become backup owners. One of the backup owners becomes the castout owner when the original castout owner no longer has read/write interest in the page set.

Other members can write this page to the group buffer pool even as the page is being cast out. Some events explicitly cause pages to be cast out to disk, such as the STOP DATABASE command.

Castout also occurs when:
  • The number of changed pages for a castout class queue exceeds a class threshold value.
  • The total number of changed pages for a group buffer pool exceeds a group buffer pool threshold value.
  • The group buffer pool checkpoint is triggered.
  • No more inter-Db2 read/write interest exists in the page set.
  • The group buffer pool is being rebuilt, but the alternate group buffer pool is not large enough to contain the pages from the group buffer that is being rebuilt.

Pages that are cast out as a result of meeting a threshold remain cached in the group buffer pool, and the buffers are available for stealing. Pages that are cast out because no more shared interest exists in the page set are purged from the group buffer pool.

Casting out from a duplexed group buffer pool

Db2 casts out data to disk only from the primary structure. After a set of pages has been cast out, the same set of pages is deleted from the secondary structure. See the DELETE NAME LIST counter in the DISPLAY GROUP BUFFERPOOL MDETAIL report for how many times this event occurs. Db2 ensures that any pages that might have been written to the group buffer pool during castout processing are not deleted from the secondary structure.