getting full volume info
Posted in 2008
Topics: General Discussion
Does anyone have a good query to get full database volume info from system tables ? Something that would incorporate the index data and the fragments ? that would give the nrows and nsize etc. ? Thanks, floyd
Hello Floyd,
This gives grand totals of what you're looking for (but it assumes
that you have 4 kb page size):
DATABASE sysmaster;
SET ISOLATION TO DIRTY READ;
-- Used_by_Data excludes
indexes!
SELECT ROUND(SUM(ti_npdata )*0.004096,0) Used_by_Data__Mb,
-- Allocated_Tables includes
indexes!
ROUND(SUM(ti_nptotal)*0.004096,0) Allocated_Tables
FROM systabinfo;
SELECT ROUND(SUM(chksize)*0.004096,0) Allocated_Chunks
FROM syschunks;