Get the App
SLTechnology News&Howtos  ›  Database  › 

Goldengate re-or add synchronized partial tables

Shulou Source: shulou.com Published: 2022-06-01 12:07:07 09月30日 Update

1. Check the primary key, check that the table to be synchronized has a primary key, and if not, add the primary key

two。 Add additional logs for the table:

Dblogin userid goldengate, password goldengate

Add trandata chunqiu.app_sta_flow_list

If you are extracting from the slave database, you can connect to the main database and add:

Dblogin userid @ chunqiu_primary, password goldengate

Add tables that need to be extracted:

Map chunqiu.app_sta_flow_list

3. Stop the application process

3. Use expdp to specify the tables required for scn export:

Reference: https://blog.51cto.com/1937519/2177360

Https://blog.51cto.com/1937519/2177352

Or get started:

Select sysdate,dbms_flashback.get_system_change_number | |''from dual

Expdp system directory=orabackup dumpfile=chunqiu_%U.dmp parallel=3 logfile=chunqiu.log tables=chunqiu.app_sta_flow_list, chunqiu.t_sta_flow_detail, chuqniu.T_BI_CUSTOMER, CLUSTER=no flashback_scn=8089801183405 exclude=trigger

4.impdp imports data to the target database

5. Edit the application process and add the following mapping

If you are using 11g ogg, you need to use double quotes "transaction", "csn", and if you are using 12c ogg, use single quotes:

How to write after goldengate12c:

Map chunqiu.app_sta_flow_list, target chunqiu.app_sta_flow_list, filter (@ GETENV ('transaction',' csn') > 8089801183405)

Goldengate 11g and previous writing:

Map chunqiu.app_sta_flow_list, target chunqiu.app_sta_flow_list, filter (@ GETENV ("transaction", "csn") > 8089801183405)

Error reference:

If you write it in the format before goldengate11G in goldengate 12C:

Map chunqiu.app_sta_flow_list, target chunqiu.app_sta_flow_list, filter (@ GETENV ("transaction", "csn") > 8089801183405)

The process will report an error with the following error message:

2018-09-27 17:59:20 INFO OGG-01298 Column function diagnostic message: could not find column "transaction".

2018-09-27 17:59:20 ERROR OGG-00375 Error in FILTER clause.

6. Start the application process, and after the application process is leveled, turn it off and use it, and remove the filter parameters:

Map chunqiu.app_sta_flow_list, target chunqiu.app_sta_flow_list

Start the application process.

Finally, I just want to make one point:

Goldengate mistakes, do not doubt life, do not doubt goldengate, live a good life, mistakes read the diary.

Tags: Process application writing quotation marks data log reference extraction check synchronization life information parameters database time is in format goal will report life Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Linux Shulou Tech Info macOS Apple