goldengate 重新或者添加同步部分表


1.检查主键,检查要同步的表时候有主键,如果没有则添加主键;

2.添加表的附加日志:

dblogin userid goldengate, password goldengate

add trandata chunqiu.app_sta_flow_list

如果是在备库上进行抽取,可以连接主库后添加:

dblogin userid @chunqiu_primary, password goldengate

添加需要抽取的表:

map chunqiu.app_sta_flow_list

3.停止应用进程

3.使用expdp指定scn导出需要的表:

扫描二维码关注公众号,回复: 3393275 查看本文章

参考:http://blog.51cto.com/1937519/2177360 

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

或者快速入门:

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导入数据到目标数据库;

5.编辑应用进程,添加如下映射

如果使用的11g的ogg,需要使用双引号"transaction","csn",如果使用的是12c的ogg使用单引号:

goldengate12c后的写法:

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

goldengate 11g及之前的写法:

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

出错参考:

如果在goldengate 12C中写成goldengate11G之前的格式:

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

则进程会报错,报错信息如下:
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.启动应用进程,等应用进程追平后,关掉就用进程,去掉过滤参数:

map chunqiu.app_sta_flow_list ,       target chunqiu.app_sta_flow_list ;

启动应用进程。


最后只想说明一点:

goldengate出错,不要怀疑人生,也不要怀疑goldengate,好好的生活,出错就看日志。

猜你喜欢

转载自blog.51cto.com/1937519/2287036
今日推荐