关于Partition列被更新的问题

一、

今天遇到这样一个问题:

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

解决办法为:

alter table owner.table_name enable row movement;

二、

SQL> create table ttt(a number)
2 partition by range(a)
3 (partition p1 values less than (10),
4 partition p2 values less than (20));

Table created.

SQL> insert into ttt values(1);

1 row created.

SQL> commit;

Commit complete.

SQL> update ttt set a=13 where a=1;
update ttt set a=13 where a=1
*
ERROR at line 1:
ORA-14402: updating partition key column would cause a partition change


SQL> alter table ttt enable row movement;

Table altered.

SQL> update ttt set a=13 where a=1;

1 row updated.

SQL> commit;

Commit complete.

SQL>

补充:

最好不要对需要UPdate的列进行分区;

好像只有到了Oracle8i才开始支持enable row movement这个子句的。

在Oracle8里面没有这样的功能。

[@more@]

请使用浏览器的分享功能分享到微信等