Simple DML operations:
Before we start, we should ensure, that replication is setup correctly and is running. Connect to dbvrep console using script start-console.sh on the source machine:
...
Code Block | ||
---|---|---|
| ||
select * from REPOE.CARD_DETAILS where card_type='REPOE_TEST'; CARD_ID CUSTOMER_ID CARD_TYPE CARD_NUMBER EXPIRY_DATE I SECURITY_CODE ---------- ----------- ------------------------------ ----------- ------------------ - ------------- 750005 1287 REPOE_TEST 9102450385 22-JAN-15 Y 1000 |
Creation of duplicate rows (potential 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 on table, that has primary key defined. In RepAttack prepared testing environment, there are just two tables, that do not have primary keys defined:
...
Code Block | ||
---|---|---|
| ||
REPOE@TTORCL_trg> 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.
...
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.
...
Code Block |
---|
REPOE@TTORCL_trg> select count(*) from repoe.logon where logon_id=1000000; COUNT(*) ---------- 0 REPOE@TTORCL_trg> select count(*) from repoe.logon where logon_id=100000000; COUNT(*) ---------- 2 |
For more information about conflicts refer to this Conflicts Chapter.
Basic DML Filters
There might be situations, where replicating whole tables is not desirable. We will now make an easy example of filter using DBVisit replicate.
Excluding Columns
For learning more about setting filters read Filter Chapter on our online wiki.
Renaming Table
Renaming Schema
DML operation with trigger / constraint DML - show cascade constraint problem
...