Oracle表空间使用率脚本

Oracle表空间使用率脚本

set linesize 200 
col tablespace format a15
col avg format a10
col max for a10
col use for a10
col free for a10
col max_block for a10
Select Initcap(f.Tablespace_Name) "tablespace",
       to_char((dSize-fSize)/dSize*100,'990.00')||'%' "avg",
       to_char(dSize,'9,999,990') "max",
       to_char(dSize-fSize,'9,999,990') "use",
       to_char(fSize,'9,999,990') "free",
       to_char(fMax,'9,999,990') "max_block"
  From (Select Tablespace_Name,
               Round(Sum(Bytes)/1048576,2) fSize,
               Round(Max(Bytes)/1048576,2) fMax
           From Dba_Free_Space
           Group By Tablespace_Name) f,
       (Select Tablespace_Name,
               Round(Sum(Bytes)/1048576,2) dSize
          From Dba_Data_Files
          Group By Tablespace_Name) d
Where d.Tablespace_Name=f.Tablespace_Name order by d.Tablespace_Name
/
原文地址:https://www.cnblogs.com/godspeed034/p/7404199.html