It seems that the tool "compare user objects" is not able to show the DDL difference among tables in presence of "anonymous constraints" (i.e. when the name is not defined by the user but is system generated).
For example :
-- STEP 1 : On the source schema I create a table with anonymous PK-constraint
create table MYTEST_GDA
(
cab NUMBER not null,
sab NUMBER not null,
tab VARCHAR2(20)
)
;
alter table MYTEST_GDA
add primary key (CAB)
;
----------
-- STEP 2: I install the same table also on the target schema by running the above script and then I re-compare.
-- Of course the name of the constraint is not the same on the 2 schemas because it is sys-generated. But the compare-tool correctly assert no difference between source and target as the DDL is really the same => OK till now!
----------
-- STEP 3. I modify the constraint on the source schema by adding another field to the PK
drop constraint SYS_XXXXXX cascade;
alter table MYTEST_GDA
add primary key (CAB, SAB)
---------
-- STEP 4 : Now I re-compare the table between source and target schema => it will always show no diffs ! => * WRONG !!!*
For example :
-- STEP 1 : On the source schema I create a table with anonymous PK-constraint
create table MYTEST_GDA
(
cab NUMBER not null,
sab NUMBER not null,
tab VARCHAR2(20)
)
;
alter table MYTEST_GDA
add primary key (CAB)
;
----------
-- STEP 2: I install the same table also on the target schema by running the above script and then I re-compare.
-- Of course the name of the constraint is not the same on the 2 schemas because it is sys-generated. But the compare-tool correctly assert no difference between source and target as the DDL is really the same => OK till now!
----------
-- STEP 3. I modify the constraint on the source schema by adding another field to the PK
drop constraint SYS_XXXXXX cascade;
alter table MYTEST_GDA
add primary key (CAB, SAB)
---------
-- STEP 4 : Now I re-compare the table between source and target schema => it will always show no diffs ! => * WRONG !!!*