shrink必须开启行迁移功能。

alter table table_name enable row movement ;

在oracle中可以使用alter table table_name shrink space收缩表,使用shrink有两个前提条件:

  1、表必须启用row movement

  2、表段所在表空间的段空间管理(segment space management)必须为auto

-shrink不能在segment space management manaual的表空间的段上执行

语法:

alter table <table_name> shrink space [ <null> | compact | cascade ];

alter table <table_name> shrink space compcat;

收缩表,相当于把块中数据打结实了,但会保持 high water mark;

alter table <tablespace_name> shrink space;

收缩表,降低 high water mark;

alter table <tablespace_name> shrink space cascade;

收缩表,降低 high water mark,并且相关索引也要收缩一下下。

alter index idxname shrink space;

回缩索引

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-05
  • 2021-12-27
  • 2021-07-01
  • 2021-09-08
  • 2019-12-06
猜你喜欢
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2022-12-23
  • 2021-08-10
相关资源
相似解决方案