Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

df and dfm #3

Open
baobao219 opened this issue Jan 21, 2019 · 1 comment
Open

df and dfm #3

baobao219 opened this issue Jan 21, 2019 · 1 comment

Comments

@baobao219
Copy link

df 和dfm 无法临时表空间的空间使用率信息,一直显示%100,建议脚本修改如下
select t.tablespace_name, t.gb "TotalGB", t.gb - nvl(f.gb,0) "UsedGB", nvl(f.gb,0) "FreeGB"
,lpad(ceil((1-nvl(f.gb,0)/decode(t.gb,0,1,t.gb))100)||'%', 6) "% Used", t.ext "Ext",
'|'||rpad(lpad('#',ceil((1-nvl(f.gb,0)/decode(t.gb,0,1,t.gb))20),'#'),20,' ')||'|' "Used"
from (
select tablespace_name, trunc(sum(bytes)/(1024
1024
1024)) gb
from dba_free_space
group by tablespace_name
union all
select tablespace_name, trunc(sum(free_blocks)8192/(102410241024)) gb
from v$sort_segment
group by tablespace_name
) f, (
select tablespace_name, trunc(sum(bytes)/(1024
10241024)) gb, max(autoextensible) ext
from dba_data_files
group by tablespace_name
union all
select tablespace_name, trunc(sum(bytes)/(1024
1024*1024)) gb, max(autoextensible) ext
from dba_temp_files
group by tablespace_name
) t
where t.tablespace_name = f.tablespace_name (+)
order by t.tablespace_name;

@ignacioruiz
Copy link

Above may require some translation:
"df and dfm cannot temporarily use the space usage information of the table space, and always display 100%. It is recommended that the script be modified as follows:"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants