ITPub博客

首页 > 数据库 > 数据库开发技术 > 检查表碎片

检查表碎片

原创 数据库开发技术 作者:maojinyu 时间:2011-03-15 17:14:00 0 删除 编辑
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/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-05-09

  • 博文量
    178
  • 访问量
    376685