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!

Exchange Partiton with a partitoned table

999670May 26 2015 — edited May 27 2015

Hi All,

Basically I want to exchange a partition with a partition in another table. << Not with entire source table data  , only subset of source data >>

I am not able to do this , because the exchange partition syntax allows only to exchange partition with a whole table .. as per below syntax

EXCHANGE PARTITION target WITH TABLE source

Is there a way I can do exchange partition with a particular partition from that source table like below

EXCHANGE PARTITION p1_target_jan_2013 WITH TABLE source where month='Jan 2013'

OR

EXCHANGE PARTITION p1_target_jan_2013 WITH TABLE source partition p1_jan_2013

we want to move data from an existing table tab1 (Source) which is already partitioned on date column for each month.

Data in source keeps resetting for each month.

i.e. when ever some calc. is run again for a given month ( Say Jan 2013), existing data related to 'Jan 2013'  is deleted first and then new data inserted for that month 'Jan
2013'. So to keep history of all the data , we want to keep moving data to history data before deleting.

As huge data is involved , want to use PARTITION EXCHNAGE , but as sited above , as I want to exchange partition with subset of rows from source table .. am not able to achive this.

Can anyone please help me ..

Regards..

This post has been answered by Martin Preiss on May 26 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 24 2015
Added on May 26 2015
9 comments
1,384 views