Exchange Partitions
Note:
Exchange partitions only work between a partition and a temporary table.
如果分区表要转换到分区表需要一个普通临时表。
Cureent 分区表到 Archival 分区表的思路如下:
需要注意的是:
- 索引的维护 UPDATE INDEXES
- 添加新的分区在历史分区表 Archival partition table 根据 current Partition table
- Archival partition table must have the same data structure and index (like column name, partition column, high value and so on) with current Partition table, but archival partition table shouldn't have the feature ——automatic adding partition
- exchange commands slightly different between normal partitioned table and composite-partitioned table
- add parition into composite-partitioned table, the subpartitions will be added automaticaly
ALTER TABLE T_NOMAL_PARTITION EXCHANGE PARTITION SYS_P2652 WITH TABLE T_NOMAL_PARTITION_TEMP UPDATE INDEXES;
ALTER TABLE T_COMP_PARTITION EXCHANGE subpartition SYS_P265_H WITH TABLE T_COMP_PARTITION_TEMP UPDATE INDEXES;
ALTER TABLE T_COMP_PARTITION_ARCH EXCHANGE subpartition SYS_P265_H WITH TABLE T_COMP_PARTITION_TEMP UPDATE INDEXES;