CREATE UNIQUE INDEX INDEX_NAME ON TABLE (COLUMN,USRID)
local
(
partition part_idx_01 tablespace index_space01,
partition part_idx_02 tablespace index_space02,
partition part_idx_03 tablespace index_space03
)
二.全局索引 1.范围索引
CREATE [UNIQUE] INDEX INDEX_NAME ON TABLE(COLUMN)
global partition by range(column)
(
partition part_idx_01 value less than(first range value) tablespace index_space01,
partition part_idx_02 value less than(second range value) tablespace index_space02,
partition part_idx_03 value less than(maxvalue) tablespace index_space03
) 2.散列索引
CREATE [UNIQUE] INDEX INDEX_NAME ON TABLE(COLUMN,[COLUMN2])
global partition by hash(column,[column2])
(
partition part_idx_01 tablespace index_space01,
partition part_idx_02 tablespace index_space02,
partition part_idx_03 tablespace index_space03
) 注:
a.分区字段不是主键的情况下,只可以创建全局分区索引,不可以创建本地主键分区索引。只有分区字段为主键时才可以创建本地主键分区索引。
b.如果创建本地唯一分区索引,除指定索引字段外还要加上表分区字段。这种索引意义不大:因为这样构成复合索引,索引改变,约束也改变了。
c.如果创建非唯一索引则不需要表分区字段。
d.创建全局分区索引后可以创建约束。