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.