Select Upper(F.Tablespace_Name) "表空间名",
D.Tot_Grootte_Mb "表空间大小(M)",
D.Tot_Grootte_Mb - F.Total_Bytes "已使用空间(M)",
To_Char(Round((D.Tot_Grootte_Mb - F.Total_Bytes) / D.Tot_Grootte_Mb * 100,2),'990.99') "使用比",
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 1 Desc;
引自:来源不清