HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Introduce partitions into an existing non-partitioned table

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
introducenonintopartitionsexistingpartitionedtable

Problem

What has to be done to introduce range partitions into an existing non-partitioned table in oracle? Is there an easy to do and safe way to do this?

Especially in cases where there are many constraints on the table like foreign keys.

Solution

This document by Tim Hall demonstrates the steps needed. It is not a non-trivial thing to do.

  • Create a Partitioned Destination Table



  • The destination must have the same constraints and indexes defined.



  • EXCHANGE PARTITION



  • Switch segments from the source table to the destination table



  • Drop the old table



  • Rename the new table and its constraints



  • SPLIT PARTITION



  • Split the single large partition into smaller partitions as required

Context

StackExchange Database Administrators Q#1684, answer score: 5

Revisions (0)

No revisions yet.