分区索引分2大类:
1 把索引信息建立在各个分区上,这叫局部索引分区
2 把索引集中起来,叫全局索引
global索引
1 索引信息的存放位置与父表的partition(分区)信息完全不想干,设置父表是不是分区表都无所谓
SQL>create index index_xxx on tablename(xxx) global partition by rang(xxx)
(
partition index_1 values less than(10) tablespace xxx,
partition index_2 values less than(maxvalue) tablespace xxx
)
2 但在这中情况下,如果父表是分区表,要删除父表的一个分区都必须要更新global index,否则索引信息不正确
SQL>alter table tablename drop partition xx unpdate global indexes;
local索引
1 索引信息的存放位置依赖于父表的partition信息,换句话说创建这样的索引必须保证父表是partition,索引信息存放在父表的分区所在的表空间
2 但是仅可以创建在父表为hashtable或者composite分区表的
3 仅可以创建在父表为hashtable或者composite分区表的,并且指定的分区数目要与父表的分区数目要一致
SQL>create index index_xxx on tablename(xxx) local;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/16546776/viewspace-687486/ ,如需转载,请注明出处,否则将追究法律责任。