oracle表分區,oracle分區

來源:互聯網
上載者:User

oracle表分區,oracle分區

oracel表分區基本上可以分成幾類:
- Range(範圍)分區
- Hash(雜湊)分區
- List(列表)分區
- 組合分區:Range-Hash, Range-List 。

1.Range(範圍)分區建立分區表
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); 

著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.