ORA-14402: updating partition key column would cause a partition change

问题描述

        当更新分区表的分区键时,会出现ORA-14402错误。


演示:

表t_order_photo 是按照EDATE为分区键的分区表。

SQL> update t_order_photo t
  2  set t.edate=sysdate,editor='Alen',photo_status=0
  3  where t.id=611;
update t_order_photo t
       *
ERROR at line 1:
ORA-14402: updating partition key column would cause a partition change


解决办法

       对该表启用行移动。

演示:

SQL> alter table t_order_photo enable row movement;

Table altered.

SQL> update t_order_photo t
  2  set t.edate=sysdate,editor='Alen',photo_status=0
  3  where t.id=611;

1 row updated.

SQL>



原文地址:https://www.cnblogs.com/alen-liu-sz/p/12975742.html