The "copy tablename" command is launched to sync the target table named table2. On target the foreign key constraint is enabled whereby the primary key of this table is referenced as foreign key by a column in another table named table1. The copy fails as follows:
sp_ctrl (source_server:port_num)> copy owner.table2
copy started; job id 81
sp_ctrl (source_server:port_num)> copy status
Job ID : 81
Host : source_server
Started : 13-JAN-09 19:27:16
Job Type : Copy
Status : Failed - Could not truncate target table
ID Tablename Total Rows %Comp Status Status Time Total Time
------ ------------------------------------ ---------- ----- ---------- ----------- ----------
1 "OWNER"."TABLE2" 2 Failed
N/A 0:27
The copy log (sync client log) shows that it failed with ORA-02266 as follows:
Tue Jan 13/19:27:43.407:: Truncating tables
Tue Jan 13/19:27:43.441:: Truncating table "OWNER"."TABLE2"
Tue Jan 13/19:27:45.743:: ERROR: ORA-2266: ORA-02266: unique/primary keys in table referenced by enabled foreign keys
at sync/oci/sync_ociquery.cpp:174 at sync/oci/sync_ociquery.cpp:199
Tue Jan 13/19:27:45.744:: ERROR: Failed to truncate table OWNER.TABLE2 at sync/clt/sync_table_handler.cpp:197
Tue Jan 13/19:27:45.745:: ERROR: Failed to truncate tables at sync/clt/sync_clt_messager.cpp:933 at sync/clt/sync_clt_messager.cpp:413
Tue Jan 13/19:27:45.746:: ERROR: An error occured at sync/clt/sync_clt_messager.cpp:341
Tue Jan 13/19:27:45.746:: Abort remaining threads
You need to be signed in and under a current maintenance contract to view premium knowledge articles.
© 2024 Quest Software Inc. ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center