在 10g 中,復合分割槽只支援 range-list 和 range-hash,而在在 11g
中復合分割槽的型別大大增加,現在 range,list,interval 都可以作為 top level
分割槽, 而 second level 則可以是 range, list, hash, 也就是在 11g 中可以有 3*3=9
種復合分割槽,滿足更多的業務需求
一:range-range
建表示例:
create table test_range_range (vl1 date,vl2 number(12))
partition by range (vl1)
subpartition by range (vl2)
(partition p1 values less than (to_date('2011-9-1', 'yyyy-mm-dd'))
(subpartition p1_1 values less than (100000),
subpartition p1_2 values less than (200000),
subpartition p1_3 values less than (maxvalue)
), partition p2 values less than (to_date('2011-10-1', 'yyyy-mm-dd'))
(subpartition p2_1 values less than (100000),
subpartition p2_2 values less than (200000),
subpartition p2_3 values less than (maxvalue)
), partition p3 values less than (maxvalue)
(subpartition p3_1 values less than (100000),
subpartition p3_2 values less than (200000),
subpartition p3_3 values less than (maxvalue)));
二:list-range
建表示例:
create table test_list_range (vl1 varchar2(20),vl2 number(12))
partition by list (vl1)
subpartition by range (vl2)
(partition p1 values ('min', 'hour','second')
(subpartition p1_1 values less than (100000),
subpartition p1_2 values less than (200000),
subpartition p1_3 values less than (maxvalue)
), partition p2 values ('day', 'month','year')
(subpartition p2_1 values less than (100000),
subpartition p2_2 values less than (200000),
subpartition p2_3 values less than (maxvalue)
), partition p3 values (default)
(subpartition p3_1 values less than (100000),
subpartition p3_2 values less than (200000),
subpartition p3_3 values less than (maxvalue)));
三:list-hash
建表示例:
create table test_list_hash (vl1 varchar2(20),vl2 number(12))
partition by list (vl1)
subpartition by hash (vl2)
subpartition template
(subpartition sp1,
subpartition sp2,
subpartition sp3,
subpartition sp4)(
partition p1 values ('min', 'hour','second'),
partition p2 values ('day', 'month','year'),
partition p3 values (default)
)
Oracle 復合分割槽
create table wzw sales acct no number 5 person varchar2 30 sales amount number 8 week no number 2 partition by range week no subpartition by list acct...
Oracle 表分割槽 復合分割槽
oracle表分割槽 範圍分割槽 oracle.表分割槽 雜湊分割槽 oracle.表分割槽 列表分割槽 oracle.表分割槽 復合分割槽 oracle表分割槽 操縱已分割槽的表 範圍分割槽與雜湊分割槽或列表分割槽的組合 語法 partition by range column name1 sub...
oracle高階 列表分割槽 復合分割槽
列表分割槽 create table student sid number,sname varchar2 20 province varchar2 20 partition by list province partition north values 河南 安徽 河北 山東 partition s...