SELECT upper(f.tablespace_name) 表空间名,
       d.Tot_grootte_Mb "表空间大小(M)",
       d.Tot_grootte_Mb - f.total_bytes "已使用空间(M)",
       round((d.Tot_grootte_Mb - f.total_bytes) / d.Tot_grootte_Mb * 100,2) "使用比",
       f.total_bytes "空闲空间(M)",
       f.max_bytes "最大块(M)"
 FROM      
    (SELECT tablespace_name,
            round(SUM(bytes)/(1024*1024),2) total_bytes,
            round(MAX(bytes)/(1024*1024),2) max_bytes
      FROM sys.dba_free_space
     GROUP BY tablespace_name) f,
    (SELECT dd.tablespace_name, round(SUM(dd.bytes)/(1024*1024),2) Tot_grootte_Mb
      FROM   sys.dba_data_files dd
      GROUP BY dd.tablespace_name) d
WHERE d.tablespace_name = f.tablespace_name    
ORDER BY 4 DESC

解决方案 »

  1.   

    guangli能否说得清楚一点,哪里的report啊?
      

  2.   

    建议你还是用toad吧,工具里面提供了比较多的管理维护方面的内容
      

  3.   

    http://www.dba123.com/list.aspx?cid=13
      

  4.   

    select  substr(a.tablespace_name,1,18) Tablespace_name,substr(a.file_name,1,60) File_path,a.avail Total_Size,nvl(b.free,0) Free,
            nvl(round(((free/avail)*100),2),0) Free_percent
    from    (select tablespace_name,substr(file_name,1,45) file_name,file_id,
                    round(sum(bytes/(1024*1024)),3) avail
             from   sys.dba_data_files
             group by tablespace_name,substr(file_name,1,45),file_id
            ) a,
            (select tablespace_name,file_id,round(sum(bytes/(1024*1024)),3) free
             from   sys.dba_free_space
             group by tablespace_name,file_id
             ) b
    where   a.file_id = b.file_id (+)
    order by 1,2
    /