Hi Everyone
Does any one know the calculation to work out the amount of space left in a tablespace or the percentage used. I know you can find this out from the control centre but is there a way to calculate it your self?
We have been doing a lot of research on this! If anyone else has better info please let us know too! Here's a query we're using right now to determine what space is being used. We also have some unix scripts to look at tablespace full info, email me and I will pass you some info.
Thanks, Tony
select t.tabschema as "Schema Name", t.tabname as "Table Name", t.card as "Num Rows", sum(c.avgcollen) as "Avg Row Length",
sum(c.avgcollen) * t.card / 1000000 as "Space Used (MB)"
from syscat.columns c, syscat.tables t
where c.tabschema <> 'SYSCAT'
and c.tabschema <> 'SYSIBM'
and c.tabschema <> 'SYSSTAT'
and c.tabname=t.tabname
and c.tabschema=t.tabschema
group by c.tabschema, c.tabname, t.tabschema, t.tabname, t.card
order by t.tabschema, t.tabname;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.