组合分区是以区间分区、列表分区、散列分区组合而成。
纵向表头是:顶层分区机制
横向表头是:子分区机制,内容是支持版本
区间分区 | 列表分区 | 散列分区 | |
区间分区 | 11g 1版本支持 | 9i 2版本支持 | 9i 1版本支持 |
列表分区 | 11g 1版本支持 | 11g 1版本支持 | 11g 1版本支持 |
散列分区 | 11g 2版本支持 | 11g 2版本支持 | 11g 2版本支持 |
--flashback table range_hash_example to before drop ;
drop table range_hash_example cascade constraints purge;
create table range_hash_example
(
range_key_date date,
hash_key number
)
partition by range(range_key_date)
subpartition by hash(hash_key) subpartitions 2
(
partition composite_main_part1 values less than(to_date('2014-1-1','YYYY-MM-DD'))
(
subpartition composite_child1_part1 tablespace learn,
subpartition composite_child1_part2 tablespace example
),
partition composite_main_part2 values less than(to_date('2015-1-1','YYYY-MM-DD'))
(
subpartition composite_child2_part1 tablespace learn,
subpartition composite_child2_part2 tablespace example
)
);
查询分区信息:分区中子分区没有显示
SQL> select t.partition_name from user_tab_partitions t where t.table_name=upper('range_hash_example') ;
PARTITION_NAME
------------------------------
COMPOSITE_MAIN_PART1
COMPOSITE_MAIN_PART2
查询段信息:只有子分区才有段;组合分区没有分区段,只有子段。
SQL> select t.partition_name from user_segments t where t.segment_name=upper('range_hash_example');
PARTITION_NAME
------------------------------
COMPOSITE_CHILD1_PART1
COMPOSITE_CHILD1_PART2
COMPOSITE_CHILD2_PART1
COMPOSITE_CHILD2_PART2