–创建list分区表:
SQL> create table t_partition_list (id number,name varchar2(50))
2 partition by list(id)(
3 partition t_list_p1 values (1,2,3,4,5,6,7,8,9) tablespace tbspart01,
4 partition t_list_p2 values (10,11,12,13,14,15,16,17,18,19) tablespace tbspart02,
5 partition t_list_p3 values (20,21,22,23,24,25,26,27,28,29) tablespace tbspart03,
6 partition t_list_pd values (default) tablespace tbspart04);
表已创建。
SQL> select TABLE_NAME,PARTITIONING_TYPE,PARTITION_COUNT from user_part_tables where TABLE_NAME = 'T_PARTITION_LIST';
TABLE_NAME PARTITI PARTITION_COUNT
------------------------------ ------- ---------------
T_PARTITION_LIST LIST 4
SQL> select PARTITION_NAME,HIGH_VALUE,TABLESPACE_NAME from user_tab_partitions where TABLE_NAME = 'T_PARTITION_LIST';
PARTITION_NAME HIGH_VALUE TABLESPACE_NAME
------------------------------ ---------- ------------------------------
T_LIST_P1 1, 2, 3, 4 TBSPART01
, 5, 6, 7,
8, 9
T_LIST_P2 10, 11, 12 TBSPART02
, 13, 14,
15, 16, 17
, 18, 19
T_LIST_P3 20, 21, 22 TBSPART03
, 23, 24,
PARTITION_NAME HIGH_VALUE TABLESPACE_NAME
------------------------------ ---------- ------------------------------
25, 26, 27
, 28, 29
T_LIST_PD default TBSPART04
上例能够实现与前面range分区示例相同的效果,当然针对本示例而言,list分区显然不好用啊~~~
版权声明:本文为zq9017197原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。