我正在尝试将分区添加到我创建的表中。我希望它在“PARTITION GRP”上进行分区,并按月份进行分区。但是我不知道如何在子分区内编写INTERVAL子句。
有人可以帮我吗?谢谢!
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')))
)
最佳答案
从the documentation:
间隔分区的限制
INTERVAL子句受以下限制:
...
因此,您不能进行间隔子分区。