Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Add Sub-partitions

Ken18May 16 2019 — edited May 27 2019

I used the below to create a partitioned table ,

alter table Table_name

modify PARTITION BY RANGE (CREATEDATE)

(

PARTITION p1 VALUES LESS THAN (TO_DATE('15-MAY-2019', 'DD-MON-YYYY')),

PARTITION p2 VALUES LESS THAN (TO_DATE('16-MAY-2019', 'DD-MON-YYYY')),

PARTITION p3 VALUES LESS THAN (maxvalue)) online;

I tried the something like below,

1)

ALTER TABLE  mytable_name

   MODIFY PARTITION P1 ADD SUBPARTITION SP1  VALUES ('0');

Error : Ensure that the table is partitioned by Composite Range method

2)

alter table mytable_name

modify PARTITION BY RANGE (CREATEDATE)

SUBPARTITION BY LIST (PID)

subpartition template(

SUBPARTITION SP1 values (0),

SUBPARTITION SP2 values (1),

SUBPARTITION SP3 values (2),

SUBPARTITION SP4 values (3));

Both doesn't work.

Can someone help me with correct way to add sub-partitions to an existing partitioned table (Range-List).

This post has been answered by Jonathan Lewis on May 27 2019
Jump to Answer

Comments

Post Details

Added on May 16 2019
19 comments
9,350 views