1.
select
name dbspace ,
round(sum(chksize)/512) allocated_m,
round((sum(chksize) - sum(nfree))/512) used_m ,
round(sum(nfree)/512) free_m,
round(((sum(chksize) - sum(nfree))/sum(chksize))*100)||"%" pcused
from sysdbspaces d, syschunks c
where d.dbsnum = c.dbsnum
group by name
order by name
2.
select round(sum(a.nfree)/512,0) free_dbs,
round(sum(a.chksize)/512,0) total_size,
b.name dbspace_name
from syschunks a,sysdbspaces b
where a.dbsnum=b.dbsnum and a.dbsnum<>2 and a.dbsnum<>3
group by 3
order by 1 desc
3.如果还想看某dbspace上都有那些表,可以用 oncheck -pe dbspace_name
4.查看数据库中表的大小
select dbsname,tabname,sum(pe_size)*4/1024
from systabnames,sysptnext
where partnum=pe_partnum
--and tabname='table_name'--(table_name为要查询的表名)
and dbsname='datadase'
group by tabname,dbsname
order by 3 desc
5、查看数据空间中数据库的大小
select s.name, e.dbsname, sum(e.size/256) usedM --IBM/256 HP/512
from sysextents e,syschunks c,sysdbspaces s
where e.chunk=c.chknum and c.dbsnum=s.dbsnum
and s.name=’dataspace’---此处可修改
group by 1,2
阅读(4872) | 评论(1) | 转发(0) |