查询表空间利用率
查询表空间利用率--考虑自增长情况,此处利用率考虑的是相对于阀值的表空间利用率
select a.tablespace_name, total || 'M', free+shortNum|| 'M' free, total-free-shortNum || 'M' as used,
Round((free+shortNum)/total * 100, 3) as "FREE%",Round((total - free-shortNum)/total * 100, 3) as "USED%" from
(select tablespace_name,autoextensible,case when t.autoextensible='YES' then (maxbytes-bytes)/1024/1024 else 0 end shortNum,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,maxbytes,bytes) 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
查询结果
设置自动增长的,可取其最大阀值,不管自增量为多少,在磁盘空间足够的情况下,表空间最终大小=阀值
没有你想要的?再逛逛:https://www.cnblogs.com/lipera/p/6201434.html
