关于oracle的partition问题,请高手指教!
uzcce 2003-10-17 01:37:03 问题描述:
建立partition的时候,用的是shijian来进行partition的分区
(partition by range(shijian)).
数据库中还有一项id
(id number primary key)
如果就此插入数据,那么id索引项的数据将不会平均的分配在各个partition上面,而只会集中存储。
如果我想把id这个索引也放在各个partition上面,我该怎么做?
已经查过一些资料,都是要求建立索引的时候必须加入"shijian"这个columns,如果我只想让id成为建立在各个partiton上面的唯一(primary key)的索引的话,有什么办法啊!!
如下的命令可以吗?
alter table b_test
add (constraint pk_b_test primary key (id)
using index local
(
partition b_test_index1 tablespace p_space1,
partition b_test_index2 tablespace p_space2,
partition b_test_index3 tablespace p_space3,
partition b_test_index4 tablespace p_space4,
partition b_test_index5 tablespace p_space5,
partition b_test_index6 tablespace p_space6,
partition b_test_index7 tablespace p_space7,
partition b_test_index8 tablespace p_space8,
partition b_test_index9 tablespace p_space9,
partition b_test_index10 tablespace p_space10,
partition b_test_index11 tablespace p_space11,
partition b_test_index12 tablespace p_space12));
谢谢!