Tuesday, April 21, 2015

How do you enable reclaimable storage or the lower high water mark after a 9.5 migration?


The high water mark (HWM) refers to the page number of the first page in the extent following the last allocated extent. For example, if a table space has 1000 pages and an extent size of 10, there are 100 extents. If the 42nd extent is the highest allocated extent in the table space that means that the high-water mark is 420.

Reclaimable storage is a feature of nontemporary automatic storage and DMS table spaces in DB2® V9.7. You can use it to consolidate in-use extents below the high water mark and return unused extents in your table space to the system for reuse.

With table spaces created before DB2 V9.7, the only way to release storage to the system was to drop containers, or reduce the size of containers by eliminating unused extents above the high water mark. There was no direct mechanism for lowering the high water mark. It could be lowered by unloading and reloading data into an empty table space, or through indirect operations, like performing table and index reorganizations. With this last approach, it might have been that the high water mark could still not be lowered, even though there were free extents below it.
To enable the inplace reduce HWM after a 9.5 to 9.7 migration the tablespaces must be dropped and recreated with a new tablespace created using DB2 9.7. Once this is done the following command can be used to lower the HWM.


ALTER TABLESPACE TS LOWER HIGH WATER MARK ALTER TABLESPACE REDUCE with the database-container-clause or all-containers-clause for non-automatic storage table spaces.