Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle, create index with partition by range

Tags:

sql

oracle

How to create an index with partition by date range, the one im using has an error when I run?

  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') );

But getting an error:

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:

Using oracle sql developer.

like image 220
Arnold Cristobal Avatar asked Sep 30 '22 04:09

Arnold Cristobal


1 Answers

Interval Partitioning is not supported for index in oracle 11g where this feature was introduced

Please note that Interval is not a valid clause for CREATE INDEX and it is valid for CREATE TABLE

INTERVAL CLAUSE IN CREATE TABLE 11G R2

GLOBAL PARTITION CLAUSE IN CREATE INDEX 11G R2

like image 104
psaraj12 Avatar answered Oct 02 '22 16:10

psaraj12