728x90

Problem(Abstract)

This article describes how to calculate space used for each table and dbspace, including how many extents are used and allocated.

Resolving the problem

Q. How do I calculate how much space is used on my instance?

A. You can use a SMI query to calculate how much space is used.

Note, however, that the output will only be accurate if you run update statistics HIGH for each table before running the query.


select  n.dbsname[1,20],
        n.tabname[1,20],
        count(*) no_extents,
        round(t.rowsize * t.nrows / 2048,0) used,
        sum( pe_size) allocated
from    sysmaster:systabnames n, sysmaster:sysptnext p, systables t
where   n.partnum = p.pe_partnum
and     n.partnum = t.partnum
and     t.tabtype = "T"
group by 1,2,4
order by 3 desc , 5 desc;

Note: This SQL assumes that you are using 2048 page size.


https://www-304.ibm.com/support/docview.wss?uid=swg21251095

728x90

+ Recent posts