Skip to Main Content

SQL & PL/SQL

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!

how to create a single-partition clone of a partitioned table ?

2899665Dec 8 2015 — edited Dec 9 2015

Hello, i would neeed to create a one-partition table which is structurally identical to an existing big partitioned table.

Say I have a table T, I need to create T0 with exactly the same columns *and storage specifications* as T, but restricted to a single partition.

Somethig akin to "create table T0 as select * from T where 1=0", but with only one partition that shares all the same characteristics as those of the source table.

I have used DBMS_METADATA.GET_DDL in the past for similar needs, but it includes the definitions of *all partitions* which i want to avoid in the present case.

The goal is to iterate in PL/SQL over the partitions of T, select from one with some transformation into T0,

then swap the only T0 partition with the partition at hand from T.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 6 2016
Added on Dec 8 2015
7 comments
2,324 views