CREATE TABLE TEST_RANGE_RANGE
(vl1 date,
vl2 number(12)
)
PARTITION BY RANGE (vl1)
SUBPARTITION BY RANGE (vl2)
SUBPARTITION TEMPLATE
(
SUBPARTITION SP1_1 VALUES LESS THAN (100000),
SUBPARTITION SP2_2 VALUES LESS THAN (200000),
SUBPARTITION SP_3 VALUES LESS THAN (MAXVALUE)
)
(
PARTITION P1 VALUES LESS THAN (TO_DATE('2011-9-1', 'YYYY-MM-DD')),
PARTITION P2 VALUES LESS THAN (TO_DATE('2011-10-1', 'YYYY-MM-DD')),
PARTITION P3 VALUES LESS THAN (MAXVALUE)
);
4.2 range-hash
CREATE TABLE TEST_RANGE_HASH
(vl1 date,
vl2 number(12)
)
PARTITION BY RANGE (vl1)
SUBPARTITION BY HASH (vl2)
SUBPARTITION TEMPLATE
(
SUBPARTITION SP1,
SUBPARTITION SP2,
SUBPARTITION SP3)
(
PARTITION P1 VALUES LESS THAN (TO_DATE('2011-9-1', 'YYYY-MM-DD')),
PARTITION P2 VALUES LESS THAN (TO_DATE('2011-10-1', 'YYYY-MM-DD')),
PARTITION P3 VALUES LESS THAN (MAXVALUE)
);
4.3 range-list
CREATE TABLE TEST_RANGE_LIST
(vl1 date,
vl2 NUMBER
)
PARTITION BY RANGE (vl1)
SUBPARTITION BY LIST (vl2)
SUBPARTITION TEMPLATE
(
SUBPARTITION P1_1 VALUES (1,2,3,4,5),
SUBPARTITION P1_2 VALUES (6,7,8,9),
SUBPARTITION P1_3 VALUES (DEFAULT))
(
PARTITION P1 VALUES LESS THAN (TO_DATE('2011-9-1', 'YYYY-MM-DD')),
PARTITION P2 VALUES LESS THAN (TO_DATE('2011-10-1', 'YYYY-MM-DD')),
PARTITION P3 VALUES LESS THAN (MAXVALUE)
);
4.4 hash-range
建表示例:
CREATE TABLE TEST_HASH_RANGE
(vl1 date,
vl2 number(12))
PARTITION BY HASH (vl1)
SUBPARTITION BY RANGE (vl2)
SUBPARTITION TEMPLATE
(
SUBPARTITION P1_1 VALUES LESS THAN (100000),
SUBPARTITION P1_2 VALUES LESS THAN (200000),
SUBPARTITION P1_3 VALUES LESS THAN (MAXVALUE)
)
(PARTITION P1,
PARTITION P2,
PARTITION P3
);