一、开启表的行迁移

alter table table_name enable row movement; 

select 'alter table '||s.owner||'.'||s.table_name||' enable row movement;'  from dba_tables s where s.OWNER in ('ISMP');

二、开始shrink表与索引

alter table table_name shrink space cascade;

select 'alter table '||s.owner||'.'||s.table_name||' shrink space cascade;' from dba_tables s where s.OWNER in ('ISMP');

三、关闭行迁移

alter table table_name disable row movement; 

select 'alter table '||s.owner||'.'||s.table_name||' disable row movement;'  from dba_tables s where s.OWNER in ('ISMP');

 posted on 2019-01-28 10:13  xibuhaohao  阅读(218)  评论(0编辑  收藏  举报