作者:13888102467波光_1984 | 来源:互联网 | 2014-07-13 17:52
Oracle表分区之复合分区范围分区与散列分区或列表分区的组合语法:[sql]PARTITIONBYRANGE(column_name1)SUBPARTITIONBYHASH(column_name2)SUBPARTITIONSnumber_of_partitions(www.2cto....
范围分区与散列分区或列表分区的组合
语法:
[sql]
PARTITION BY RANGE (column_name1)
SUBPARTITION BY HASH (column_name2)
SUBPARTITIONS number_of_partitions
( www.2cto.com
PARTITION part1 VALUE LESS THAN(range1),
PARTITION part2 VALUE LESS THAN(range2),
...
PARTITION partN VALUE LESS THAN(MAXVALUE)
);
例:
[sql]
CREATE TABLE SALES
(
PRODUCT_ID VARCHAR2 (5),
SALES_DATE DATE NOT NULL,
SALES_COST NUMBER (10)
) www.2cto.com
PARTITION BY RANGE (SALES_DATE)
SUBPARTITION BY HASH (PRODUCT_ID)
SUBPARTITIONS 5
(
PARTITION S1 VALUES LESS THAN (TO_DATE(‘01/4月/2001','DD/MON/YYYY')),
PARTITION S2 VALUES LESS THAN (TO_DATE(‘01/7月/2001','DD/MON/YYYY')),
PARTITION S3 VALUES LESS THAN (TO_DATE(‘01/9月/2001','DD/MON/YYYY')),
PARTITION S4 VALUES LESS THAN (MAXVALUE)
);
作者 jason5186