只要索引的引导列包含分区键,就是有前缀的分区索引。
4.3 索引重建问题
(1)分区索引
对于分区索引,不能整体进行重建,只能对单个分区进行重建。语法如下:
Alter index idx_name rebuild partition index_partition_name [online nologging]
说明: online:表示重建的时候不会锁表。
nologging:表示建立索引的时候不生成日志,加快速度。
如果要重建分区索引,只能drop表原索引,在重新创建:
SQL>create index loc_xxxx_col on xxxx(col) local tablespace SYSTEM;
这个操作要求较大的临时表空间和排序区。
示例:
SQL> select index_name,partition_name from user_ind_partitions where index_name='I_TIME_GLOBAL';
INDEX_NAME PARTITION_NAME
------------------------------ ------------------------------
I_TIME_GLOBAL P1
I_TIME_GLOBAL P2
SQL> alter index I_TIME_GLOBAL rebuild partition p1 online nologging;
索引已更改。
SQL> alter index I_TIME_GLOBAL rebuild partition p2 online nologging;
索引已更改。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12961536/viewspace-769489/
,如需转载,请注明出处,否则将追究法律责任。