Oracle table partition, oracle Partition
The partition of the pivoel table can basically be divided into several categories:
-Range Partition
-Hash Partition
-List partitions
-Combined partitions: Range-Hash and Range-List.
1. Create a partition table using Range partitions
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 Test Data
Insert into TABLE_PARTITION (COL1, COL2) VALUES (1, 'Data test'); insert into TABLE_PARTITION (COL1, COL2) VALUES (23, 'Data test '); insert into TABLE_PARTITION (COL1, COL2) VALUES (449000, 'Data test'); insert into TABLE_PARTITION (COL1, COL2) VALUES (450000, 'Data test '); insert into TABLE_PARTITION (COL1, COL2) VALUES (1350000, 'Data test'); insert into TABLE_PARTITION (COL1, COL2) VALUES (900000, 'Data test '); insert into TABLE_PARTITION (COL1, COL2) VALUES (1800000-1, 'Data test'); COMMIT;
View data in a partition
SELECT * FROM TABLE_PARTITION partition(TAB_PARTOTION_02);
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.