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!

Split Partitioning by Date

Mike1255Jun 22 2017 — edited Jun 22 2017

Hi all,

I have a lot of tables that were partitioned by the last DBA by year but the last 10+ years no new partitions were created.

so basically I have tables that have partition names like P1, P2, P3, P4 and PMAX that correspond to years 1/1/2002, 2003, 2004, 2005 and MAXVALUE.

Partitions.png

I have used the following code to add new partitions:

ALTER TABLE "<Schema>"."<Tablename>" SPLIT PARTITION "PMAX" AT (TO_DATE('01/01/2006','MM/DD/YYYY')) INTO (PARTITION "P5", PARTITION "PMAX") UPDATE INDEXES PARALLEL;

ALTER TABLE "<Schema>"."<Tablename>" SPLIT PARTITION "PMAX" AT (TO_DATE('01/01/2007','MM/DD/YYYY')) INTO (PARTITION "P6", PARTITION "PMAX") UPDATE INDEXES PARALLEL;

I was wondering if it's possible to start at the other end......by creating a partition for 2017 data before 2006 - 2016 and if so, how to change the code?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 20 2017
Added on Jun 22 2017
5 comments
1,388 views