DB2重构表及索引

    当一个表或索引被重复的进行增、删、改操作以后,必然会出现大量的碎片,这时就需要对这些对象进行重构。重构的过程,就是对部分数据打散再重新组合的过程,因而可能会出现对象失效的情况。

Reorg:
该命令用于对表、索引等进行重建。

重构指定表:
db2 => reorg table tabx

在线重构表:
db2 => reorg table tabx inplace allow write access

离线重构表:
db2 => reorg table tabx allow read access

离线重构索引:
db2 => reorg table tabx index db2inst.pk_tabx allow read access

在线重构索引:
db2 => reorg table tabx index db2inst.pk_tabx inplace allow write access

猜你喜欢

转载自hidatas.iteye.com/blog/1915913