Oracle 检查表空间使用情况

--检查表空间使用情况
  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";

posted @ 2016-11-24 15:31  全威儒  阅读(553)  评论(0编辑  收藏  举报