Oracle,按范围创建分区索引

时间:2014-12-20 01:02:26

标签: sql oracle

如何创建一个按日期范围分区的索引,我运行时使用的那个有错误吗?

  CREATE INDEX "PV_TNPM"."TEJAS_SDH_PM_PDH_IDX2" ON "PV_TNPM"."TEJAS_SDH_PM_PDH" ("DATETIME","NODE_NAME", "NODE_IP", "OBJECT_NAME")
 GLOBAL PARTITION BY RANGE(DATETIME) INTERVAL (INTERVAL '15' MINUTE)
(PARTITION INITIAL_PARTITION VALUES LESS THAN (DATE '2014-10-10') );

但是收到错误:

Error starting at line : 11 in command -
CREATE INDEX "PV_TNPM"."TEJAS_SDH_PM_PDH_IDX2" ON "PV_TNPM"."TEJAS_SDH_PM_PDH"     ("DATETIME","NODE_NAME", "NODE_IP", "OBJECT_NAME")
GLOBAL PARTITION BY RANGE(DATETIME) INTERVAL (INTERVAL '15' MINUTE)
(PARTITION INITIAL_PARTITION VALUES LESS THAN (DATE '2014-10-10') )
Error at Command Line : 12 Column : 37
Error report -
SQL Error: ORA-00906: missing left parenthesis
00906. 00000 -  "missing left parenthesis"
*Cause:    
*Action:

使用oracle sql developer。

1 个答案:

答案 0 :(得分:3)

引入此功能的oracle 11g中的索引不支持间隔分区

请注意,Interval不是CREATE INDEX的有效子句,它对CREATE TABLE

有效

INTERVAL CLAUSE IN CREATE TABLE 11G R2

GLOBAL PARTITION CLAUSE IN CREATE INDEX 11G R2