2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > oracle数据库分区表建立索引

oracle数据库分区表建立索引

时间:2019-11-02 21:46:39

相关推荐

oracle数据库分区表建立索引

分区表和一般表一样可以建立索引,分区表可以创建局部索引和全局索引。当分区中出现许多事务并且要保证所有分区中的数据记录的唯一性时采用全局索引。

1. 局部索引分区的建立:create index idx_t on AAA(id)

local

(

partition idx_1 tablespace space01,

partition idx_2 tablespace space02,

partition idx_3 tablespace space03

);

2. 全局索引建立时global 子句允许指定索引的范围值,这个范围值为索引字段的范围值:create index idx_t on AAA(id)

global partition by range(id)

(

partition idx_1 values less than (1000) tablespace space01,

partition idx_2 values less than (10000) tablespace space02,

partition idx_3 values less than (maxvalue) tablespace space03

);

当然也可以不指定索引分区名直接对整个表建立索引:

create index idx_t on AAA(id);

参考:/kobejayandy/article/details/8774949

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。