标签:oracle
oracel表分区基本上可以分成几类:
- Range(范围)分区
- Hash(哈希)分区
- List(列表)分区
- 组合分区:Range-Hash, Range-List 。
CREATE TABLE TABLE_PARTITION(
COL1 NUMBER,
COL2 VARCHAR2(100)
)
partition by range(COL1)(
partition TAB_PARTOTION_01 values less than (450000),
partition TAB_PARTOTION_02 values less than (900000),
partition TAB_PARTOTION_03 values less than (1350000),
partition TAB_PARTOTION_04 values less than (1800000),
partition TAB_PARTOTION_OTHER values less THAN (MAXVALUE)
);
INSERT INTO TABLE_PARTITION(COL1,COL2)
VALUES(1,‘数据测试‘);
INSERT INTO TABLE_PARTITION(COL1,COL2)
VALUES(23,‘数据测试‘);
INSERT INTO TABLE_PARTITION(COL1,COL2)
VALUES(449000,‘数据测试‘);
INSERT INTO TABLE_PARTITION(COL1,COL2)
VALUES(450000,‘数据测试‘);
INSERT INTO TABLE_PARTITION(COL1,COL2)
VALUES(1350000,‘数据测试‘);
INSERT INTO TABLE_PARTITION(COL1,COL2)
VALUES(900000,‘数据测试‘);
INSERT INTO TABLE_PARTITION(COL1,COL2)
VALUES(1800000-1,‘数据测试‘);
COMMIT;
SELECT * FROM TABLE_PARTITION partition(TAB_PARTOTION_02);
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:oracle
原文地址:http://blog.csdn.net/jameshadoop/article/details/48105433