查看存档策略 - 我们必须存档特定数据集。
而不是插入/删除例程 - 我正在考虑使用分区交换。
待归档表是按日期划分的区间范围,按国家/地区划分列表子分区。
我要对特定国家/地区进行分区交换。
create table
test_table
(tbl_id number,
country varchar2(2),
sales_dt date,
volume number)
partition by range (sales_dt) interval (NUMTOYMINTERVAL(1,'Month'))
subpartition by list (country)
Subpartition template
(subpartition p_ireland values ('IR'),
subpartition p_france values ('FR'),
subpartition p_other values (DEFAULT))
(partition before_2008 values less than (to_date('01-JAN-2008','DD-MON-YYYY')));
加载的数据正确落入分区和子分区。所有分区名称都是系统生成的。
当我对所有“FR”子分区进行分区交换时,我无法确定逻辑。
使用
Alter table test_table
exchange subpartition system_generated_name
with table TEST_TABLE_ARCH;
我可以换出一个特定的“已知”子分区。
我知道您可以在 Oracle 11g 中使用“for”逻辑,但无法使语法正常工作。
有任何想法吗?