Sunday, 19 January 2014

DB2 V9.7 - Reduce Tablespace Size

I have got an opportunity to work with different versions of DB2 LUW environments.
This is what I follow if I need to reduce the size/hwm of tablespace.

For TBS migrated to V9.7 -with Automatic storage  - alter tablespace tbs reduce
For TBS migrated to V9.7 - without Automatic storage  - alter tablespace tbsname reduce (all 1000)   - 1000 is no.of pages
For TBS created in V9.7 - Automatic storage - alter tablespace tbsname reduce max
For TBS created in V9.7 - without Automatic storage - alter tablespace tbsname lower high water mark

Monitor the progress in V9.7 using below command
select varchar(tbsp_name, 15) as tbsp_name, tbsp_state from table (mon_get_tablespace('TBS1',-2)) as t;



Hope this helps.

No comments:

Post a Comment