我创建分区表的语句如下:
CREATE TABLE T_JC_CF
PART
ITION BY RANGE (KFTIME)
SUBPARTITION BY LIST (YY_ID)
SUBPARTITION TEMPLATE
(SUBPARTITION sy VALUES ('45535063-x'),
SUBPARTITION hh VALUES ('455350656'),
SUBPARTITION nk VALUES ('45535071-X'),
SUBPARTITION fy VALUES ('003005'),
SUBPARTITION zyy VALUES ('004081'),
SUBPARTITION other VALUES (DEFAULT)
)
(
PARTITION p0810 VALUES LESS THAN (TO_DATE('2008-10-01', 'YYYY-MM-DD')),
PARTITION p0901 VALUES LESS THAN (TO_DATE('2009-01-01', 'YYYY-MM-DD')),
PARTITION p0904 VALUES LESS THAN (TO_DATE('2009-04-01', 'YYYY-MM-DD')),
PARTITION p0907 VALUES LESS THAN (TO_DATE('2009-07-01', 'YYYY-MM-DD')),
PARTITION p0910 VALUES LESS THAN (TO_DATE('2009-10-01', 'YYYY-MM-DD')),
PARTITION pmax VALUES LESS THAN (MAXVALUE))
nologging AS SELECT * FROM T_JC_CFbak;
这样用到了组合分区,我现在怎样创建这样的组合分区索引
ORACLE 创建组合分区索引如下:
create index idx_ename on T_JC_CF(字段掘旦坦)
local
(
partition p0810 tablespace USERS,
partition p0901 tablespace USERS,
partition p0904 tablespace USERS,
partition p0907 tablespace USERS,
partition p0910 tablespace USERS,
partition pmax tablespace USERS
)
分区索引总结;分区索引分为2类:
1、global,它必定是Prefix的。不存在non-prefix的
2、local,它又分成2类:
2.1、prefix:索引的第一个列等于判桐表的分区列。
2.2、non-prefix:索引的第一个列不等于表迟历的分区列。
create index idx_ename on T_JC_CF(字段)
local
(
partition p0810 tablespace USERS,
partition p0901 tablespace USERS,
partition p0904 tablespace USERS,
partition p0907 tablespace USERS,
partition p0910 tablespace USERS,
partition pmax tablespace USERS
)