database sysmaster
select t1.dbsname,
format_units(sum(ti_nptotal),max(ti_pagesize)) allocated_size,
format_units(sum(ti_npused),max(ti_pagesize)) used_size
from systabnames t1, systabinfo t2,sysdatabases t3
where t1.partnum = t2.ti_partnum
and trim(t3.name)=trim(t1.dbsname)
group by dbsname
order by sum(ti_nptotal) desc;
————————————————