1、oracle 表分区主要是为了容易管理和性能方面考虑,有四种分区方法:1.区间分区:create table range_example(range_column number,sj date)PARTITION BY RANGE(range_column)(PARTITION part_1 VALUE LESS THAN(18),PARTITION part_2 VALUE LESS THAN(40),PARTITION part_3 VALUE LESS THAN(120);2.散列分区create table range_example(range_column number,sj da
2、te)PARTITION BY HASH(range_column)(PARTITION part_1,PARTITION part_2);使用散列分区你无法控制一行放在哪个分区中,如果改变散列分区的个数,所有的数据都将在分区中重新分布.3.列表分区create table range_example(range_column number,sj date)PARTITION BY LIST(range_column)(PARTITION part_1 VALUES(1,2,3),PARTITION part_2 VALUES(4,5,6),PARTITION part_2 VALUES(de
3、fault);4.组合分区组合分区是区间分区和散列分区的组合或区间分区和列表分区的组合,顶层分区总是区间分区,第二层分区可能是列表分区或散列分区create table range_example(range_column number,id varchar2(2),sj date)PARTITION BY RANGE(range_column)SUBPARTITION BY LIST(id)(PARTITION part_1 VALUES LESS THAN(18)(SUBPARTITOIN part_sub_1 VALUES(A,B,C),SUBPARTITOIN part_sub_2 VALUES(D,E,F)PARTIRION part_2 VALUES LESS THAN(40)(SUBPARTITION part_sub_3 VALUES(AA,BB,CC),SUBPARTITION part_sub_4 VALUES(DD,EE,FF)PARTITION part_3 VALUES LESS THAN(120)(SUBPARTITION part_sub_5 VALUES(default)