查看表空间剩余和已经使用的大小
时间:2010-08-18 来源:hxl
普通表空间:
Select a.Tablespace_Name, Total, Free, Total - Free Used
From (Select Tablespace_Name, Sum(Bytes) / 1024 / 1024 Total
From Dba_Data_Files
group By Tablespace_Name) a,
(Select Tablespace_Name, Sum(Bytes) / 1024 / 1024 Free
From Dba_Free_Space
group By Tablespace_Name) b
where a.Tablespace_Name = b.Tablespace_Name;
临时表空间: Select a.Tablespace_Name,
Sum(b.Bytes) / 1024 / 1024 As Toal_Size,
Sum(a.Free_Space) / 1024 / 1024 As Free_Size,
Sum(b.Bytes) / 1024 / 1024 - Sum(a.Free_Space) / 1024 / 1024 As Used_Size
From Dba_Temp_Free_Space a, Dba_Temp_Files b
Where a.Tablespace_Name = b.Tablespace_Name
Group By a.Tablespace_Name
From (Select Tablespace_Name, Sum(Bytes) / 1024 / 1024 Total
From Dba_Data_Files
group By Tablespace_Name) a,
(Select Tablespace_Name, Sum(Bytes) / 1024 / 1024 Free
From Dba_Free_Space
group By Tablespace_Name) b
where a.Tablespace_Name = b.Tablespace_Name;
临时表空间: Select a.Tablespace_Name,
Sum(b.Bytes) / 1024 / 1024 As Toal_Size,
Sum(a.Free_Space) / 1024 / 1024 As Free_Size,
Sum(b.Bytes) / 1024 / 1024 - Sum(a.Free_Space) / 1024 / 1024 As Used_Size
From Dba_Temp_Free_Space a, Dba_Temp_Files b
Where a.Tablespace_Name = b.Tablespace_Name
Group By a.Tablespace_Name
相关阅读 更多 +