700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > Oracle中查看表空间的使用率的脚本

Oracle中查看表空间的使用率的脚本

时间:2020-06-18 13:10:34

相关推荐

Oracle中查看表空间的使用率的脚本

如题:

select f.tablespace_name tablespace_name,

round((d.sumbytes / 1024 / 1024 / 1024), 2) total_g,

round(f.sumbytes / 1024 / 1024 / 1024, 2) free_g,

round((d.sumbytes - f.sumbytes) / 1024 / 1024 / 1024, 2) used_g,

round((d.sumbytes - f.sumbytes) * 100 / d.sumbytes, 2) used_percent

from (select tablespace_name, sum(bytes) sumbytes

from dba_free_space

group by tablespace_name) f,

(select tablespace_name, sum(bytes) sumbytes

from dba_data_files

group by tablespace_name

union

select tablespace_name, sum(bytes)

from dba_temp_files

group by tablespace_name) d

where f.tablespace_name = d.tablespace_name

order by d.tablespace_name;

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。