Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

updating partition Key, row movement not allowed

i want to update a partition key. the partition is as below

PARTITION_NAME  LAST_ANALYZED   NUM_ROWS    BLOCKS  SAMPLE_SIZE HIGH_VALUE
PORTAL_SERVICE_1    12/8/2016   4133    174 4133    1
PORTAL_SERVICE_2    6/8/2016    4474    174 4474    2
PORTAL_SERVICE_3    10/8/2016   29602   2014    29602   3
PORTAL_SERVICE_OTHERS   24/5/2016   0   110     DEFAULT

this partition is applied on column Portal_Service_id. i want to update the value of portal service id from 2 to 1.

when i try

update trans set PORTAL_SERVICE_ID = 1 where ID = 2054;

i get error: Error report - SQL Error: ORA-14402: updating partition key column would cause a partition change 14402. 00000 - "updating partition key column would cause a partition change"

i am not allowed to use Enable Row Movement.

Can anybody please suggest any alternative to update the row.

can anybody shed some light if this can be used in the scenario:

UPDATE <table_name> PARTITION (<partition_name>)
SET <column_name> = <value>
WHERE <column_name> <condition> <value>;
like image 752
Ps-kl Avatar asked Oct 21 '25 06:10

Ps-kl


2 Answers

to work around the error "ORA-14402: updating partition key column would cause a partition change" you can follow these steps

1) Check if for your table is enabled the row_movement

SELECT owner, table_name, row_movement FROM dba_tables WHERE table_name in ('YOUR_TABLE');

2) If is disabled you can enable movement with this script

alter table YOUR_TABLE enable row movement;

After that you can update the partition key column

like image 86
Gio Italy Avatar answered Oct 25 '25 03:10

Gio Italy


Enable row movement with this syntex , it will solve the error :

alter table <table_name> enable row movement

like image 32
Bhaskar Avatar answered Oct 25 '25 03:10

Bhaskar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!