1. truncate分区
SQL操作命令:
alter table part_table truncate partition p1;
- 全局索引:失效
- 分区索引:正常、没影响
如何避免失效:
alter table part_table truncate partition p1 update global indexes;
2. drop分区
SQL操作命令:
alter table part_table drop partition p1;
- 全局索引:失效
- 分区索引:正常、没影响
如何避免失效:
alter table part_table drop partition p1 update global indexes;
3. add分区
SQL操作命令:
alter table part_table add partition p5 values less than(37210);
- 全局索引:正常、没影响
- 分区索引:正常、没影响
4. split分区
SQL操作命令:
alter table part_table split partition p_max at(10086) into (partition p6,partition p_max);
- 全局索引:失效
- 分区索引:如果max区中已经有记录了,这个时候split就会导致有记录的新增分区的局部索引失效。
如何避免失效:
- 针对全局索引:
alter table part_table split partition p_max at (10086) into (partition p6,partition p_max) update global indexes;
- 针对分区索引,需要重建局部索引:
alter index idx_part_split_col1 rebuild;
5. exchange分区
SQL操作命令:
alter table part_table exchange partition p1 with table normal_table including indexes;
- 全局索引:失效
- 分区索引:正常、没影响
如何避免失效:
alter table part_table exchange partition p1 with table normal_table including indexes update global indexes;
附表格,如下:

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




