分类: Oracle
2009-10-30 00:48:40
select a.tablespace_name, round(a.total_size,1) "total(M)",
round(a.total_size)-round(nvl(b.free_size,0),1) "used(M)",
round(nvl(b.free_size,0),1) "free(M)",
round(nvl(b.free_size,0)/total_size*100,1) "free rate(%)"
from (select tablespace_name,sum(bytes)/1024/1024 total_size
from dba_data_files
group by tablespace_name) a,
(select tablespace_name,sum(bytes)/1024/1024 free_size
from dba_free_space
group by tablespace_name) b
where a.tablespace_name = b.tablespace_name(+)
order by "free rate(%)";