lixiaobin
-- 剩余容量
select sum(bytes) FREE from DBA_FREE_SPACE where tablespace_name =\'xxx\';
-- 总容量
select sum(bytes) TOTAL from DBA_DATA_FILES where tablespace_name =\'xxx\';

 

查询整个数据库剩余和使用的表空间大小使用情况:

select df.tablespace_name "表空间名",totalspace "总空间M",freespace "剩余空间M",round((1-freespace/totalspace)*100,2) "使用率%" 
from 
(select tablespace_name,round(sum(bytes)/1024/1024) totalspace 
from dba_data_files 
group by tablespace_name) df, 
(select tablespace_name,round(sum(bytes)/1024/1024) freespace 
from dba_free_space 
group by tablespace_name) fs 
where df.tablespace_name=fs.tablespace_name;

 

分类:

技术点:

相关文章:

  • 2021-11-16
  • 2021-11-28
  • 2021-11-13
  • 2021-11-06
  • 2021-11-19
  • 2021-11-04
  • 2021-09-17
  • 2021-11-16
猜你喜欢
  • 2021-11-02
  • 2021-08-14
  • 2021-11-03
  • 2021-11-19
  • 2021-11-23
  • 2021-08-14
  • 2021-11-23
  • 2021-08-24
相关资源
相似解决方案