Oracle query table space statistics

select df.tablespace_name
      ,format_bytes(df.total_space) as total_space
      ,format_bytes(df.total_space - fs.free_space) as used_space
      ,format_bytes(fs.free_space) as free_space
from (select tablespace_name, sum(bytes) as total_space
      from dba_data_files
      group by tablespace_name
     ) df,
     (select tablespace_name, sum(bytes) as free_space
      from dba_free_space
      group by tablespace_name
     ) fs
where df.tablespace_name = fs.tablespace_name
order by df.tablespace_name
;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章