To force the conflict, update Ok, now we have set up the data for our test, lets do something that you wouldn't normally do. That is, we need to force a conflict between the source and target table by deliberately updating a record in the target table to table to a different value than in the the source table table.
1. On the target table on the target server, run the following SQL to update the value
No Format |
---|
sqlplus repoe/repoe@ttorcl_trg |
No Format |
The current value of the amount_received for prod_id 101 in the SALES table is NULL. Update this to 60 on the target.
No Format |
---|
UPDATE sales SET amount_received = 60 WHERE sales_status = 'OVERDUE' AND prod_id = 101; COMMIT; |
2. The AMOUNT_RECEIVED column in record PROD_ID = 101 on 101 in the target table now differs from the source.
Now lets update the same column in the same record on the source (with a different value) and see what happens when Replicate tries to apply that change on the target.
3. Update the AMOUNT_RECEIVED for PROD_ID = 101 on the source database. On source server run the following SQL to update the value
No Format |
---|
sqlplus repoe/repoe@ttorcl_src |
No Format |
---|
SQL>UPDATE sales update SALES setSET AMOUNTamount_RECEIVEDreceived = 120 where SALES_STATUS WHERE sales_status = 'OVERDUE' andAND PRODprod_IDid = 101; commitCOMMIT; |
4. This will create a conflict because the update statement will be replicated to the target database. The target value was already changed and so a conflict was is created.
5. On the replication console the conflict will be shown.
...