当先锋百科网

首页 1 2 3 4 5 6 7

 

查看各个表空间使用情况。单位为:G

 select
b.file_id ,
b.tablespace_name ,
b.bytes/(1000*1000*1000) total_space ,
(b.bytes-sum(nvl(a.bytes,0)))/(1000*1000*1000) uesed_space,
sum(nvl(a.bytes,0))/(1000*1000*1000) free_space,
sum(nvl(a.bytes,0))/(b.bytes)*100 free_rate
from dba_free_space a,dba_data_files b
where a.file_id=b.file_id
group by b.tablespace_name,b.file_id,b.bytes
order by b.file_id;