dba_free_space:描述数据空间的剩余大小
dba_data_file:描述数据表空间的总大小
select a.tablespace_name, a.bytes bytes_used, b.largest,round(((a.bytes-b.bytes)/a.bytes)*100,2) percent_used from (select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) a , (select tablespace_name , sum(bytes) bytes ,max(bytes) largest from dba_free_space group by tablespace_name) b where a.tablespace_name = b.tablespace_name
Order by ((a.bytes - b.bytes)/a.bytes) DESC;
当发现表空间超过80%则需要扩大表空间:
alert tablespace .... add datafile
本文介绍了一种检查Oracle数据库中表空间使用情况的方法,并提供了一个SQL脚本来评估表空间的使用率。当表空间使用率达到80%时,脚本会触发表空间扩容警告。
2875

被折叠的 条评论
为什么被折叠?



