Database Error Messages

Release
toggle
  • 23ai
  • 21c
  • 19c
Updated
Jun 24, 2024

OCI-05026

cannot delete or update parent key referenced by sharded table

Cause

An attempt was made to delete or update a row from a duplicated table when a foreign key constraint existed in a sharded table referencing this duplicated table and the constraint was ENABLED.


Action

DISABLE NOVALIDATE the constraint before attempting to delete or update rows from the duplicated table. When a sharded table references a duplicated table, deleting a parent row is only allowed when the constraint is in DISABLE state. This means rows from the child sharded table are not looked up for violation. The constraint state can later be changed to ENABLE VALIDATE if there are no rows in sharded table violating the constraint and after duplicated table is refreshed on all shards.