alter tablespace .. resize...
see infocenter for detailed command
Best Regards, Guy Przytula
Database Software Consultant
Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
Information Server Datastage Certified http://www.infocura.be
It's possible to arrange for each new range-partition to occupy a dedicated tablespace, easy with automatic storage.
This has the advantage of simpler space recovery following rollout of the oldest ranges (detach, archive, drop table, drop tablespace).
SELECT 'ALTER TABLESPACE '||p.TBSP_NAME||' REDUCE '
WHEN 1 THEN RTRIM(CHAR(p.tbsp_usable_pages-p.tbsp_page_top))
ELSE '(ALL '||RTRIM(CHAR((p.tbsp_usable_pages-p.tbsp_page_top)/nullif(p.tbsp_num_containers, 0)))||')'
||' ON DBPARTITIONNUM ('||RTRIM(CHAR(P.DBPARTITIONNUM))||')'
FROM SYSIBMADM.SNAPTBSP_PART P
JOIN SYSIBMADM.SNAPTBSP T ON P.TBSP_NAME=T.TBSP_NAME AND P.DBPARTITIONNUM=T.DBPARTITIONNUM