スキーマ毎の容量調査(Mbytes)
select sum(bytes)/(1024*1024) "SIZE[M]" from dba_segments where owner='<スキーマ名>';
表領域毎の容量調査(Mbytes)
select tablespace_name, sum(bytes)/(1024*1024) "SIZE[M]"
from dba_data_files group by tablespace_name;
表領域毎の空き容量調査(Mbytes)
SELECT tablespace_name, trunc(SUM(bytes)/(1024*1024)) "Free[M]"
FROM dba_free_space GROUP BY tablespace_name;
表領域毎の調査(Mbytes)
select
d.tablespace_name,
SIZE "SIZE[MB]",
round(SIZE-空き容量) "使用量[MB]",
round((1 - (空き容量/SIZE))*100) "使用率(%)",
空き容量 "空き容量[MB]"
from
(SELECT tablespace_name, round(SUM(bytes)/(1024*1024)) "SIZE"
FROM dba_data_files GROUP BY tablespace_name) d,
(SELECT tablespace_name, round(SUM(bytes)/(1024*1024)) "空き容量"
FROM dba_free_space GROUP BY tablespace_name) f
where d.tablespace_name=f.tablespace_name
/