LoginSignup
14
13

More than 5 years have passed since last update.

Oracle:容量調査

Posted at

スキーマ毎の容量調査(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
/
14
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
13