研究、分享我学习零售业SAP的历程
------------打造中国第一个零售SAP博客

方法1:

select ff.s tablespace_name,

ff.b total,

(ff.b - fr.b) usage,

fr.b free,

round((ff.b - fr.b) / ff.b * 100) || '% ' usagep

from (select tablespace_name s, sum(bytes) / 1024 / 1024 b

from dba_data_files

group by tablespace_name) ff,

(select tablespace_name s, sum(bytes) / 1024 / 1024 b

from dba_free_space

group by tablespace_name) fr

where ff.s = fr.s

方法2:

select a.owner,a.segment_name,segment_type,sum(bytes)/1024 as SizeM From dba_segments a

inner join (

select owner,segment_name from dba_lobs where table_name ='XI_AF_MSG' union all

select owner,index_name as segment_name from dba_indexes where table_name ='XI_AF_MSG' union all

select owner,segment_name from dba_segments where segment_name='XI_AF_MSG'

) b on a.owner=b.owner and a.segment_name=b.segment_name

group by a.owner,a.segment_name,segment_type

order by a.segment_name

posted on 2009-06-04 09:21  会东  阅读(593)  评论(0编辑  收藏  举报