Partitioned Table Purging Live Steps

create table archive.archive_tasks partition by range (TIME) (partition ARC_Pdefault values less than (to_date(’01-10-2008′, ‘DD-MM-YYYY’)) ) as select * from tasks where 1=2 ;

create table archive.partition_holder_tasks as select * from TASKS where 1=2;

alter table TASKS exchange partition Pdefault with table archive.partition_holder_tasks;

alter table archive.archive_tasks exchange partition arc_pdefault with table archive.partition_holder_tasks;

— Adding Partition
alter table archive.archive_tasks add partition P1460 values less than (to_date(‘2016-09-13 00:00:00′,’yyyy-mm-dd hh24:mi:ss’));

alter table TASKS exchange partition sys_p1460 with table archive.partition_holder_tasks;

alter table archive.archive_tasks exchange partition p1460 with table archive.partition_holder_tasks;

Drop existing Partition

Rebuild Index created on Base table.

Leave a Reply

Your email address will not be published. Required fields are marked *

18 ÷ = 2