欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

查询表空间利用率

程序员文章站 2022-06-14 09:45:11
查询表空间利用率: select a.tablespace_name, total, free, total-free as used, substr(free/total * 100, 1, 5) as "FREE%", substr((total - free)/total * 100, 1, ......

查询表空间利用率:

select a.tablespace_name, total, free, total-free as used, substr(free/total * 100, 1, 5) as "free%",

substr((total - free)/total * 100, 1, 5) as "used%" from
(select tablespace_name, case when t.autoextensible='yes' then sum(maxbytes)/1024/1024 else
sum(bytes)/1024/1024 end as total from dba_data_files t group by tablespace_name,autoextensible) a,
(select tablespace_name, sum(bytes)/1024/1024 as free from dba_free_space group by tablespace_name) b
where a.tablespace_name = b.tablespace_name order by a.tablespace_name

查询结果

查询表空间利用率