查看oracle表空间的使用情况

 1 select
 2   b.file_id 文件ID号,  3   b.tablespace_name 表空间名,  4   b.bytes/1024/1024 ||'MB' 字节数,  5   (b.bytes-sum(nvl(a.bytes,0)))/1024/1024 ||'MB' 已使用,  6   sum(nvl(a.bytes,0))/1024/1024 ||'MB' 剩余空间,  7   sum(nvl(a.bytes,0))/(b.bytes)*100 ||'%'剩余百分比  8   from dba_free_space a,dba_data_files b  9   where a.file_id=b.file_id
10   group by b.tablespace_name,b.file_id,b.bytes 11   order by b.file_id

 

你可能感兴趣的:(oracle)