Get the App
SLTechnology News&Howtos  ›  Database  › 

What is the colmap mapping in ogg?

Shulou Source: shulou.com Published: 2022-05-31 13:12:37 10月04日 Update

What is the colmap mapping in ogg? aiming at this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

First, the source and destination create the table:

Source: create table tb02 (col1 int, col2 int, col3 int)

Target: create table tb02 (col1 int, col3 int, col2 int)

Extraction process

GGSCI (pc6) 2 > edit params ext_s1

Extract ext_s1

Setenv (NLS_LANG= "AMERICAN_AMERICA.AL32UTF8")

Setenv (ORACLE_SID= "hyyk")

Userid ogg,password oracle

Gettruncates

-- FORMATASCII, NONAMES, DELIMITER'|'

-- FORMATSQL ORACLE, NONAMES

-- FORMATXML

Exttrail / u01/app/oggs/dirdat/ss

-- table sender.tab1, TOKENS (TK-CSN=@getenv ('TRANSACTION','CSN'))

Table sender.*

-- table sender.tb10, where (col3 = @ PRESENT and col1 > 10)

Delivery process

GGSCI (pc6) 5 > edit params pump_s1

Extract pump_s1

Passthru

Userid ogg,password oracle

Rmthost 192.168.1.80,mgrport 7809

Rmttrail / u01/app/oggd/dirdat/sd

-- table sender.tab1

-- table sender.tb10

Table sender.*

Replication process

GGSCI (ogg-80) 2 > edit params rep_s1

Replicat rep_s1

Setenv (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)

Setenv (ORACLE_SID= "ogg")

Userid ogg,password oracle

-- handlecollisions

ASSUMETARGETDEFS

DISCARDFILE. / dirrpt/rorabb.dsc,PURGE

Userid ogg,password oracle

Map sender.tab1,target receiver.tab1

Map sender.tb10,target receiver.tb10

Map sender.tb02,target receiver.tb02

Source insert record:

SENDER@hyyk > insert into tb02 values (1, 2, 3)

SENDER@hyyk > commit

View data on the source side

SENDER@hyyk > select * from tb02

COL1 COL2 COL3

1 2 3

Target side view

It is emphasized here that if it is ogg11g, the result should be like this.

COL1 COL3 COL2

1 2 3

It indicates that ogg 11g is in the order of columns, not by column names.

If it is ogg12c, the result should be like this, while this article uses ogg12c

RECEIVER@ogg > select * from tb02

COL1 COL3 COL2

1 3 2

It indicates that ogg 12c corresponds to column names, not column order.

For the problem of ogg 11g, we want to implement using column names to map

Method 1:

First of all, we want to add colmap to test:

MAP SENDER.TB02, TARGET RECEIVER.TB02, colmap (usedefaults, col2=col3, col3=col2)

The source side inserts the data again

Insert into tb02 values (2, 3, 4)

Commit

target

SQL > select * from gtj.tb02

COL1 COL3 COL2

1 2 3

2 4 3

It is found that the data are consistent. Here is an explanation.

MAP SENDER.TB02, TARGET RECEIVER.TB02, colmap (usedefaults, col2=col3, col3=col2)

The equal sign here is the target end on the left and the source end on the right.

Method 2:

Use definition files

GGSCI (pc6) 2 > edit params defgen

DEFSFILE. / dirdef/test.def

USERID ogg, PASSWORD oracle

TABLE sender.tb02

The test.def file is generated and ftp is transferred to the target dirdef file directory.

Target rep2 process modification:

-- ASSUMETARGETDEFS

SOURCEDEFS. / dirdef/test.def

After the rep2 process is restarted, the source insert operation is performed again at this time: insert into tb02 values (3mem4jin5)

Check the target results:

Select * from gtj.tb02

COL1 COL3 COL2

1 2 3

2 3 4

3 5 4

Ok, the result is right.

The correct mapping or configuration definition file for colmap (it can be implemented without colmap at this time, but in many cases, if the structure is inconsistent, the definition file is still needed). In actual production, if you want to configure colmap, you must pay attention to testing to ensure that the correct results are online again.

Method 3:

Execute insert into tb02 (col1,col2,col3) values (11pm 12pm 13)

This is the answer to the question about the colmap mapping in ogg. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

Tags: Goals files results processes methods problems data consistency again more order help tests solutions configuration easy right easy content right Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei vpn OPPO Reno Xiaomi Shulou Technology