SQL> conn jay/jay
Connected.
SQL> CREATE TABLE ROW_MOVEMENT_PART_TEST
2 (
3 E_ID NUMBER NOT NULL,
4 D_ID VARCHAR2 (15) NOT NULL
5 )
6 PARTITION BY LIST (D_ID)
7 (
8 PARTITION P1 VALUES ('1'),
9 PARTITION P2 VALUES ('2'),
10 PARTITION P3 VALUES ('3'));
Table created.
SQL> INSERT INTO ROW_MOVEMENT_PART_TEST VALUES (100, '1');
1 row created.
SQL> INSERT INTO ROW_MOVEMENT_PART_TEST VALUES (101, '1');
1 row created.
SQL>
SQL> INSERT INTO ROW_MOVEMENT_PART_TEST VALUES (102, '1');
1 row created.
SQL>
SQL> INSERT INTO ROW_MOVEMENT_PART_TEST VALUES (103, '1');
1 row created.
SQL> commit;
Commit complete.
SQL> UPDATE ROW_MOVEMENT_PART_TEST SET D_ID=2 WHERE E_ID=103;
UPDATE ROW_MOVEMENT_PART_TEST SET D_ID=2 WHERE E_ID=103
*
ERROR at line 1:
ORA-14402: updating partition key column would cause a partition change
SQL>
SQL> ALTER TABLE ROW_MOVEMENT_PART_TEST ENABLE ROW MOVEMENT;
Table altered.
SQL> UPDATE ROW_MOVEMENT_PART_TEST SET D_ID=2 WHERE E_ID=103;
1 row updated.
SQL> commit;
Commit complete.
SQL> ALTER TABLE ROW_MOVEMENT_PART_TEST DISABLE ROW MOVEMENT;
Table altered.
SQL> spool off
No comments:
Post a Comment