Good day to all! Help solve this issue. I create a partitioned table in which there are partitions and subpartitions (by dates, the table is divided into years, and years are divided into quarters) I create it this way:
CREATE TABLE test_composite
(str_kv VARCHAR2 (100 BYTE) NOT NULL,
d_1 date not null,
d_2 date not null)
PARTITION BY RANGE (d_1)
SUBPARTITION BY RANGE (d_2)
(
PARTITION t_2016 VALUES LESS THAN (TO_DATE ('01 .01.2017 ',' DD.MM.YYYY '))
(
SUBPARTITION t_20161 VALUES LESS THAN (TO_DATE ('01 .04.2016 ',' DD / MM / YYYY ')),
SUBPARTITION t_20162 VALUES LESS THAN (TO_DATE ('01 .07.2016 ',' DD / MM / YYYY ')),
SUBPARTITION t_20163 VALUES LESS THAN (TO_DATE ('01. 10.2016 ',' DD / MM / YYYY ')),
SUBPARTITION t_20164 VALUES LESS THAN (MAXVALUE)
),
PARTITION t_2017 VALUES LESS THAN (TO_DATE ('01 .01.2018 ',' DD.MM.YYYY '))
(
SUBPARTITION t_20171 VALUES LESS THAN (TO_DATE ('01 .04.2017 ',' DD / MM / YYYY ')),
SUBPARTITION t_20172 VALUES LESS THAN (TO_DATE ('01 .07.2017 ',' DD / MM / YYYY ')),
SUBPARTITION t_20173 VALUES LESS THAN (TO_DATE ('01 .10.2017 ',' DD / MM / YYYY ')),
SUBPARTITION t_20174 VALUES LESS THAN (MAXVALUE)
),
PARTITION t_max VALUES LESS THAN (maxvalue)
); Everything works, then the question arises, how can you optimize the process of creating new partitions (because the table will expand)? I only know how to break the existing partition (t_max) into two, but how can I do a single operation so that the entire structure is reproduced, along with all the subpartitions? At the moment, when the main partition is divided, an automatic subpartition with a system name is created, which is neither to the village nor to the city. I would be very grateful for the help, and the more detailed the help, the better =)