(5) modify the column value on the primary key. The update operation is split

Source: Internet
Author: User
Example of an external data experiment (5) modifying the column value on the primary key, the update operation will be split into two statements to continue the external data experiment (4) verify that the updata and delete operations result in non-synchronization. Address: Click to open the link environment: ItemSourceSystemTargetSystemPlatformRedHatEnterpriseLinux

Example of an external data experiment (5) modifying the column value on the primary key, the update operation will be split into two statements to continue the external data experiment (4) verify that external data finds out the non-synchronization caused by updata and delete operations. Address: Click to open the link environment: Item Source System Target System Platform Red Hat Enterprise Linux

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.