select t.table_name,
avg_row_len * num_rows / (1 - pct_free / 100) / 8192 actual_block,
alloc_block,
1 - ((avg_row_len * num_rows / (1 - pct_free / 100) / 8192) / alloc_block) percen,
'alter table '||t.table_name||'enable row movement'||';' enable_row,
'alter table '||t.table_name||'shrink space'||';' ddl_shrink
from (select segment_name, sum(blocks) alloc_block
from user_extents
having sum(blocks) > 8
group by segment_name) a,
user_tables t
where a.segment_name = t.table_name
and num_rows is not null
and num_rows > 0
order by 4 desc[@more@]
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9907339/viewspace-1047310/
,如需转载,请注明出处,否则将追究法律责任。