column tbs_name format a30
select
a.tablespace_name TBS_NAME,
round(b.total/1024/1024) "TOTAL(M)",
round((b.total-a.free)/1024/1024) "USED(M)",
round(a.free/1024/1024) "FREE(M)",
round((b.total-a.free)/b.total,4)*100 "USED(%)"
from
(
select
tablespace_name,
sum(bytes) free
from
dba_free_space
group by
tablespace_name
) a,
(
select
tablespace_name,
sum(bytes) total
from
dba_data_files
group by
tablespace_name
) b
where
a.tablespace_name = b.tablespace_name
union all
select
tablespace_name TBS_NAME,
sum(bytes)/1024/1024 "TOTAL(M)",
null "USED(M)",
null "FREE(M)",
null "USED(%)"
from
dba_temp_files
group by tablespace_name
order by "USED(%)" desc
/
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22558114/viewspace-1097801/
,如需转载,请注明出处,否则将追究法律责任。