...
- no rows affected
- more than one row affected
- other type of error
In this previous chapter we will introduce first 2 types of conflictintroduced the first type of the conflict, now we will introduce 2nd type of conflict - more rows affected.
Creation of duplicate rows (potential more than one row affected conflict):
In order to simulate conflict in replication, we have to create at least one row, that is precise clone of another row. This cannot be created done on table, that has primary key defined. In RepAttack prepared testing environment, there are just two tables, that do not have primary keys defined:
REPOE.LOGON and REPOE.ORDERENTRY_METADATA. We will use the REPOE.LOGON table for duplicate creation. Run following insert on source database to create duplicity:
No Format | ||
---|---|---|
| ||
REPOE@TTORCL_SRC>REPOE@SOURCE> insert into repoe.logon select * from repoe.logon where logon_id=1000000; 1 row created. REPOE@TTORCL_SRC>REPOE@SOURCE> commit; Commit complete. |
Wait until the row gets replicated and confirm it also with dbvrep console.
Check, that the duplicated row also exists in the target database.
No Format | ||
---|---|---|
| ||
REPOE@TTORCL_trg>REPOE@TARGET> select * from repoe.logon where logon_id=1000000 order by customer_id; LOGON_ID CUSTOMER_ID LOGON_DATE ---------- ----------- ------------------ 1000000 496840 31-MAR-06 1000000 496840 31-MAR-06 |
Create conflict
Using the duplicate row we prepared in previous chapter, we can now simulate conflict in replication.
On source database run following update command.
No Format | ||
---|---|---|
| ||
REPOE@TTORCL_SRC>REPOE@SOURCE> update repoe.logon set logon_id=logon_id*100 where logon_id=1000000; 2 rows updated. REPOE@TTORCL_SRC>REPOE@SOURCE> commit; Commit complete. |
Check in the console, that we have really created the conflict
...
At this moment the apply process stopped and is waiting for manual resolve of the conflict.
Listing and Resolving Conflicts
As we have created a conflict, we have to see what exactly happened.
...
Now we have to check whether our two rows got replicated:
No Format |
---|
REPOE@TTORCL_trg>REPOE@TARGET> select count(*) from repoe.logon where logon_id=1000000; COUNT(*) ---------- 0 REPOE@TTORCL_trg>REPOE@TARGET> select count(*) from repoe.logon where logon_id=100000000; COUNT(*) ---------- 2 |
...