gcbm1984
gcbm1984

Reputation: 59

using INTERVAL (NUMTOYMINTERVAL (1,'MONTH') in SUBPARTITION

I'm trying to add partitions to a table I created. I want it partitioned on "PARTITION GRP" and subpartitioned by month. But I don't know how to write the INTERVAL clause inside a subpartition. Can someone help me on this? thanks!

PARTITION BY RANGE (PARTITION_GRP)
SUBPARTITION BY RANGE (RPTG_MTH_DATE)
INTERVAL(NUMTOYMINTERVAL(1,'MONTH'))
(
   PARTITION PG_0 VALUES LESS THAN (1)
  (SUBPARTITION PG_0_201401 VALUES LESS THAN (TO_DATE('1-FEB-2014', 'DD-MON-YYYY'))),
   PARTITION PG_1 VALUES LESS THAN (2)
  (SUBPARTITION PG_1_201401 VALUES LESS THAN (TO_DATE('1-FEB-2014', 'DD-MON-YYYY'))),   
   PARTITION PG_2 VALUES LESS THAN (3)
  (SUBPARTITION PG_2_201401 VALUES LESS THAN (TO_DATE('1-FEB-2014', 'DD-MON-YYYY'))),
   PARTITION PG_3 VALUES LESS THAN (4)
  (SUBPARTITION PG_3_201401 VALUES LESS THAN (TO_DATE('1-FEB-2014', 'DD-MON-YYYY'))),
   PARTITION PG_4 VALUES LESS THAN (MAXVALUE)
  (SUBPARTITION PG_4_201401 VALUES LESS THAN (TO_DATE('1-FEB-2014', 'DD-MON-YYYY')))
 ) 

Upvotes: 3

Views: 9425

Answers (1)

Alex Poole
Alex Poole

Reputation: 191235

From the documentation:

Restrictions on Interval Partitioning
The INTERVAL clause is subject to the following restrictions:

  • You can specify only one partitioning key column, and it must be of NUMBER or DATE type.
  • This clause is not supported for index-organized tables.
  • You cannot create a domain index on an interval-partitioned table.
  • Interval partitioning is not supported at the subpartition level. ...

So you can't have interval subpartitioning.

Upvotes: 6

Related Questions