在使用分区表时,需要注意的一个问题是,当我们更新分区字段时,可能会遇到如下错误:
这个错误的解释是:
为了解决这个问题,可以使用如下命令更改分区表的属性:
更改分区表的分区键值,意味着要删除记录并重新插入一条新的记录,这会引起记录(Record)的移动,记录的Rowid会改变,相关索引需要进行维护。
SQL> update DOM_REAL_CATEGORY_FL set doc_level=101 where doc_level=51;
update DOM_REAL_CATEGORY_FL set doc_level=101 where doc_level=51
*
ERROR at line 1:
ORA-14402: updating partition key column would cause a partition change
这个错误的解释是:
ORA-14402: updating partition key column would cause a partition change
Cause: An UPDATE statement attempted to change the value of a partition key column causing migration of the row to another partition
Action: Do not attempt to update a partition key column or make sure that the new partition key is within the range containing the old partition key.
为了解决这个问题,可以使用如下命令更改分区表的属性:
SQL> alter table DOM_REAL_CATEGORY_FL enable row movement;
Table altered.
更改分区表的分区键值,意味着要删除记录并重新插入一条新的记录,这会引起记录(Record)的移动,记录的Rowid会改变,相关索引需要进行维护。
SQL> update DOM_REAL_CATEGORY_FL set doc_level=101 where doc_level=51;
57024 rows updated.
Elapsed: 00:00:34.61
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




