table space usage
Posted in 2001
Topics: General Discussion
Can someone show me how to find out how big space was allocated for a table and how much has been used? Thanks. Thanh Ngo
oncheck -pT databasename:tablename
Art S. Kagel
Thanh Ngo wrote:
>
> Can someone show me how to find out how big space was allocated for a table and
> how much has been used?
>
> Thanks.
> Thanh Ngo
"Thanh Ngo" <t-ngo@ti.com> wrote in message news:3A84542A.142710DA@ti.com...
> Can someone show me how to find out how big space was allocated for a
table and
> how much has been used?
--------------------------------------------------
-- Size table space usage (pages)
-- IDS 7.30+
--------------------------------------------------
select n.tabname
, substr(ti_nrows,1,8) num_rows
, substr(sum(ti_nptotal),1,6) total_p
, substr(sum(ti_npused),1,6) used_p
, substr(sum(ti_npdata),1,6) data_p
, substr((sum(ti_npused)-sum(ti_npdata)),1,6) nodata
, substr((sum(ti_nptotal)-sum(ti_npused)),1,6) free_p
, substr(round(sum(ti_nptotal*v.sh_pagesize/1024)),1,7) total_kb
from sysmaster:systabinfo i,sysmaster:systabnames n,sysmaster:sysshmvals
v,systables s
where i.ti_partnum = n.partnum
and n.partnum=s.partnum
and n.dbsname= <dbname>
and n.tabname matches
--'Table name or *'
--
Best regards
Vasyl Shulzhenko
Softline Ltd.
http://www.softline-solutions.com/
http://softline.kiev.ua/