Managing the opening and closing of data sets
Having the needed data sets open and available for use is important for the performance of transactions. However, the number of open data sets affects the amount of available storage, and the number of open data sets in read/write state affects restart time.
About this task
Db2 uses a deferred close process to delay the physical closing of page sets or partitions until necessary, to avoid extra I/O processing. Page set refers to the set of data pages for a table space or index.
Deferred close enables other applications or users to access unused table spaces and associated indexes, without reopening the data sets or partitions.
Db2 dynamically manages page sets by using two levels of closure:
- Logical closure
- When the application is deallocated from that page set. Logical closure happens at commit or deallocation time, depending on the value of the RELEASE bind option and the use count. When a page set is logically closed, the page set use count is decremented. When the page set use count is zero, the page set is considered not in use, and the page set becomes a candidate for physical closure.
- Physical closure
- When Db2 closes and deallocates the data sets for the page set.
Db2 defers the closing and de-allocating of open table spaces or indexes until the number of open data sets approaches the value of the DSMAX subsystem parameter. The CLOSE option of the CREATE TABLESPACE and CREATE INDEX statements specifies the priority in which data sets are closed.
Procedure
To control the maximum number of open data sets, use the following approaches: