深入学习Oracle分区表及分区索引(2)-创建range分区
本文向读者介绍了如果创建range分区的方法。
② 创建global索引range分区:
| JSSWEB> create index idx_parti_range_id on t_partition_range(id) 2 global partition by range(id)( 3 partition i_range_p1 values less than (10) tablespace tbspart01, 4 partition i_range_p2 values less than (40) tablespace tbspart02, 5 partition i_range_pmax values less than (maxvalue) tablespace tbspart03); |
索引已创建。
由上例可以看出,创建global索引的分区与创建表的分区语句格式完全相同,而且其分区形式与索引所在表的分区形式没有关联关系。
注意:我们这里借助上面的表t_partition_range来演示创建range分区的global索引,并不表示range分区的表,只能创建range分区的global索引,只要你想,也可以为其创建hash分区的global索引。
查询索引的分区信息可以通过user_part_indexes、user_ind_partitions两个数据字典:
| JSSWEB> select index_name, partitioning_type, partition_count
2 From user_part_indexes 3 where index_name = 'IDX_PARTI_RANGE_ID';
------------------------------ ------- --------------- IDX_PARTI_RANGE_ID RANGE 3
2 from user_ind_partitions 3 where index_name = 'IDX_PARTI_RANGE_ID' 4 order by partition_position;
------------------------------ ---------- -------------------- I_RANGE_P1 10 TBSPART01 I_RANGE_P2 40 TBSPART02 I_RANGE_PMAX MAXVALUE TBSPART03 |
- 本文关键词:

