How To
Summary
Starting from Db2 v10.1, system managed (SMS) and database managed (DMS) table spaces have been deprecated and automatic storage table spaces have become the default user table space.
As automatic storage table spaces manage container storage for you, the database manager seeks to maximize space utilization by creating and extending table space containers only as needed. Therefore, maintenance operations to manually extend automatic storage table spaces are not available.
One benefit of extending table space containers upfront is avoiding the penalty of multiple extensions later as the table space grows.
Steps
- Determine currently used table space size:
-
$ db2pd -db dbname -tablespace Tablespace Statistics: Address Id TotalPgs UsablePgs UsedPgs PndFreePgs FreePgs HWM Max HWM State MinRecTime NQuiescers PathsDropped TrackmodState 0x00007FA90C444700 2 8192 8160 96 0 8064 96 96 0x00000000 0 0 No n/a
where used table space size is UsedPgs * page_size. ex) 96 * 4096
-
- Calculate a delta between N bytes and current table space size:
- delta = N - (UsablePgs * page_size)
- Alter tablespace increasesize to the delta:
- db2 alter tablespace <tablespace_name> increasesize <delta>
- Issue alter tablespace reduce max:
- db2 alter tablespace <tablespace_name> reduce max
- Wait until the reduce max finishes:
- db2pd -extentmovement
- Create a dummy table to allocate an extent in the table space for the auto resize:
- db2 create table <table_name> in <tablespace_name>
Related Information
Document Location
Worldwide
Was this topic helpful?
Document Information
Modified date:
10 October 2019
UID
ibm11078515