Example (5) modify the column value on the primary key. The update operation is split into two statements.
Continue with "Example of the upload data experiment (4) Verify that the upload data finds out the non-synchronization caused by the updata and delete operations". Address: Click to open the link.
Environment:
Item |
Source System |
Target System |
Platform |
Red Hat Enterprise Linux Server release 5.4 |
Red Hat Enterprise Linux Server release 5.4 |
Hostname |
Gc1 |
Gc2 |
Database |
Oracle 10.2.0.1 |
Oracle 11.2.0.1 |
Character Set |
ZHS16GBK |
ZHS16GBK |
ORACLE_SID |
PROD |
EMREP |
Listener Name/Port |
LISTENER/1521 |
LISTENER/1521 |
Goldengate User |
Ogg |
Ogg |
1. Simulate the experiment environment so that gc1 and gc2 data is not synchronized, and update the primary key column on gc2
GGSCI (gc1) 7>Stop RORA_1
Sending STOP request to REPLICAT RORA_1...
Request processed.
GGSCI (gc1) 8>Info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING
Extract running EORA_1 00:00:00 00:00:01
Extract running PORA_1 00:00:00 00:00:05
Replicat stopped RORA_1 00:00:00 00:00:01
Gc2:
SQL>Update TCUSTMER set CUST_CODE = 'new' WHERENAME = 'Rocky flyer inc. '; -- updata operation on gc2
SQL>Commit;
SQL>Select * from TCUSTMER where CUST_CODE = 'new ';
CUST_CODE NAME CITY ST
--------------------------------------------------------------
New rocky flyer inc. SHANGHAI CO
Gc1:
SQL>Select * from TCUSTMER where CUST_CODE = 'new'; -- gc1 query, no synchronous changes, no Query
No rows selected
SQL>Select * from TCUSTMER where CUST_CODE = 'jar'; -- the original data is retained on gc1.
CUST_CODE NAME CITY ST
--------------------------------------------------------------
Jane rocky flyer inc. SHANGHAI CO
2. Run the export data command to display the result as follows:
-- Volume data does not capture the update operation, but splits it into insert and delete operations.
Summary:
As we can see from the above, when the column where the primary key is updated is located, ignore data cannot capture this is the update operation, but by comparing the two tables, split the update operation into insert and delete operations.
3. Process Synchronization
GGSCI (gc1) 10>Start RORA_1
Sending START request to MANAGER...
REPLICAT RORA_1 starting
GGSCI (gc1) 11>Info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING
Extract running EORA_1 00:00:00 00:00:02
Extract running PORA_1 00:00:00 00:00:00
Replicat running RORA_1 00:12:48 00:00:02
SQL>Select * from TCUSTMER where CUST_CODE = 'new ';
CUST_CODE NAME CITY ST
--------------------------------------------------------------
New rocky flyer inc. SHANGHAI CO
****************** ********
Statement:
Original works, from "Deep Blue blog" blog, allow reprint, reprint please be sure to indicate the source (http://blog.csdn.net/huangyanlong ).
The author has the right to pursue legal liability for copyright issues.