Thursday, July 30, 2009

Database size

select dbsname DatabaseName,
trunc(sum((ti_nptotal * ti_pagesize ) / 1024/ 1024),2) || "Mb" sizeallocated,
trunc(sum((ti_npused * ti_pagesize ) / 1024/ 1024),2) || "Mb" usedsize
from sysmaster:systabinfo A, sysmaster:sysptprof B
where A.ti_partnum = B.partnum
and B.tabname not matches "TBL*" and B.dbsname not matches "*TEMP*"
and B.tabname not matches "sys*"
and B.dbsname not in ('sysmaster', 'sysutils')
group by 1

No comments: