关于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));

谢谢!
...全文
267 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧