Oracle DBA & All IT » Database, DBA, ORA-Error, Oracle, Oracle Tips » วิธีแก้ไขให้ update column key partition ได้ (ORA-14402)
วิธีแก้ไขให้ update column key partition ได้ (ORA-14402)
ERROR at line 1:
ORA-14402: updating partition key column would cause a partition change
เกิดจากการที่เราพยายามจะ update ค่า column ที่เป็น key partition
สามารถทำการแก้ไขได้โดยใช้คำสั่ง
alter table [TABLE_NAME] enable row movement;
และทำการ lock ไม่ให้ update อีกครั้งโดยคำสั่ง
alter table [TABLE_NAME] disable row movement;
แค่นี้เราก็สามารถ update column key partition ได้แล้วจ้า
ตัวอย่าง..
SQL> create table part_test
2 (id number, doc varchar2(30))
3 partition by range (id)
4 (partition p1 values less than (100),
5 partition p2 values less than (maxvalue));
Table created.
SQL> insert into part_test values(1,'donghua');
1 row created.
SQL> commit;
Commit complete.
SQL> update part_test set id=id+100;
update part_test set id=id+100
*
ERROR at line 1:
ORA-14402: updating partition key column would cause a partition change
SQL> alter table part_test enable row movement;
Table altered.
SQL> update part_test set id=id+100;
1 row updated.
SQL> commit;
Commit complete.
SQL> alter table part_test disable row movement;
Table altered.
Related Search:
Filed under: Database, DBA, ORA-Error, Oracle, Oracle Tips · Tags: error, ora-14402, ORA-14402: updating partition key column would cause a partition change, oracle, partition key