Oracle表空间使用率查询

来源:互联网 发布:淘宝优惠券代理群 编辑:程序博客网 时间:2024/05/04 16:37
SELECT f.tablespace_name
       , a.total "total (M)"
       , f.free "free (M)"
       , ROUND ( (f.free / a.total) * 100) "% Free"
    FROM (  SELECT tablespace_name, SUM (bytes / (1024 * 1024)) total
              FROM dba_data_files
          GROUP BY tablespace_name) a
       , (  SELECT tablespace_name, ROUND (SUM (bytes / (1024 * 1024))) free
              FROM dba_free_space
          GROUP BY tablespace_name) f
   WHERE a.tablespace_name = f.tablespace_name(+)
ORDER BY "% Free";
原创粉丝点击