Oracle 高水位(HWM: High Water Mark) 2017-04-14 02:49:28


SELECT a.owner,

a.index_name,

a.index_type,

a.partitioned,

a.status,

b.status p_status,

b.composite

FROM dba_indexes a

LEFT JOIN

dba_ind_partitions b

ON a.owner = b.index_owner AND a.index_name = b.index_name

WHERE a.owner = '&owner' AND a.table_name = '&table_name';

对于普通索引直接rebuild online nologging parallel,

对于分区索引,必须单独rebuild 每个分区,

对于组合分区索引,必须单独rebuild 每个子分区。

Move 通过移动数据来来降低HWM,因此需要更多的磁盘空间。 Shrink 通过delete 和 insert, 会产生较多的undo 和redo。


shrink space收缩到数据存储的最小值,alter table move(不带参数)收缩到initial指定值,也可以用alter table test move storage(initial 500k)指定收缩的大小,这样可以达到shrink space效果。

总之,使用Move 效率会高点,但是会导致索引失效。Shrink 会产生undo 和redo,速度相对也慢一点。