返回顶部
首页 > 资讯 > 数据库 >ogg参数之handlecollisions
  • 547
分享到

ogg参数之handlecollisions

2024-04-02 19:04:59 547人浏览 薄情痞子
摘要

本文主要探讨 handlecollisions 参数的作用。   环境 ogg12c 版本。 源端目标端都在 a 列上有主键。   准

本文主要探讨 handlecollisions 参数的作用。

 

环境

ogg12c 版本。

源端目标端都在 a 列上有主键。

 

准备工作

停掉抽取进程和投递进程

源端插入几条数据

源端抽取进程跳过这些 insert , alter extract EXT_MI01,begin now

启动抽取进程和投递进程

 

Delete 实验

目标端

sql> select * from t3;

 

           A EUTIME                   B

---------- --------------- ----------

           1                          3

           2 22-OCT-18                3

           3 22-OCT-18                3

 

3 rows selected.

 

 

源端:

SQL> select * from t3;

 

           A EUTIME                   B

---------- --------------- ----------

           1                          3

           2 22-OCT-18                3

           3 22-OCT-18                3

           4 23-OCT-18                3

           5 23-OCT-18                3

 

5 rows selected.

 

 

源端 delete ,并提交

SQL> delete from t3 where a=4;

 

 

复制进程 abend :

2018-10-23 14:39:05  WARNING OGG-01004  Aborted grouped transaction on 'MING.T3',   Database error 1403 (OCI Error ORA-01403: no data found, SQL   <DELETE FROM "MING"."T3"  WHERE "A" = :b0 A

ND "EUTIME" = :b1 AND   "B" = :b2 AND ROWNUM = 1>).

 

2018-10-23 14:39:05  WARNING OGG-01003  Repositioning to rba 2135 in seqno 7.

 

2018-10-23 14:39:05  WARNING   OGG-01154  SQL error 1403 mapping   MING.T3 to MING.T3 OCI Error ORA-01403: no data found, SQL <DELETE   FROM "MING"."T3"    WHERE "A" = :b0 AND "EUTIME" = :b1 AND

 "B" = :b2 AND ROWNUM = 1>.

 

Source Context :

    SourceModule            :   [er.errors]

    SourceID                :   [/scratch/aime/adestore/views/aime_adc4150330/ogGCore/OpenSys/src/app/er/errors.cpp]

    SourceFunction          :   [take_rep_err_action]

    SourceLine              : [941]

    ThreadBacktrace         : [15]   elements

                          :   [/u01/app/oracle/products/ogg/libgglog.so(CMessageContext::AddThreadContext()+0x1b)   [0x7f9d6f0554eb]]

                          :   [/u01/app/oracle/products/ogg/libgglog.so(CMessageFactory::CreateMessage(CSourceContext*,   unsigned int, ...)+0x135) [0x7f9d6f04f5c5]]

                          :   [/u01/app/oracle/products/ogg/libgglog.so(_MSG_ERR_MAP_TO_TANDEM_FAILED(CSourceContext*,   ggs::gglib::ggapp::CQualDBObjName<(DBObjType)1> const&,   ggs::gglib::g

gapp::CQualDBObjName<(DBObjType)1>   const&, CMessageFactory::MessageDisposition)+0x50) [0x7f9d6f048c7c]]

                          :   [/u01/app/oracle/products/ogg/replicat(take_rep_err_action(short, int, char   const*, extr_ptr_def*, std_rec_hdr_def*, char*, file_def*, bool)+0x17aa)   [0x5b63ef

]]

                          :   [/u01/app/oracle/products/ogg/replicat(replicate_io(ggs::gglib::ggdatasource::DataSource*,   file_def*, ggs::gglib::gglcr::CommonLCR const*, ggs::gglib::gglcr::

CommonLCR*, extr_ptr_def*, int*,   int)+0x3847) [0x63ad27]]

                          :   [/u01/app/oracle/products/ogg/replicat(process_record(ggs::gglib::ggdatasource::DataSource*,   file_def*&, ggs::gglib::gglcr::CommonLCR const*, ggs::gglib::gglc

r::CommonLCR*, short&,   extr_ptr_def*&, extr_ptr_def*&, int&, int&, int&,   bool)+0x2f8) [0x63f018]]

                          :   [/u01/app/oracle/products/ogg/replicat(ggs::er::ReplicatContext::processReplicatLoop(ggs::Heartbeat::MapGeneratorParams&)+0x1061)   [0x5f6cc1]]

                          :   [/u01/app/oracle/products/ogg/replicat(ggs::er::ReplicatContext::run(ggs::Heartbeat::MapGeneratorParams&)+0x29)   [0x5eae39]]

                          :   [/u01/app/oracle/products/ogg/replicat() [0x633c7b]]

                          :   [/u01/app/oracle/products/ogg/replicat(ggs::gglib::MultiThreading::MainThread::ExecMain()+0x60)   [0x6ecbe0]]

                          :   [/u01/app/oracle/products/ogg/replicat(ggs::gglib::MultiThreading::Thread::RunThread(ggs::gglib::MultiThreading::Thread::ThreadArgs*)+0x14d)   [0x6edbfd]]

                          :   [/u01/app/oracle/products/ogg/replicat(ggs::gglib::MultiThreading::MainThread::Run(int,   char**)+0xb1) [0x6edce1]]

                          :   [/u01/app/oracle/products/ogg/replicat(main+0x3b) [0x636c9b]]

                          :   [/lib64/libc.so.6(__libc_start_main+0xfd) [0x37cba1ed1d]]

                          :   [/u01/app/oracle/products/ogg/replicat() [0x56c559]]

 

2018-10-23 14:39:05  ERROR   OGG-01296    Error mapping from MING.T3 to MING.T3.

 

 

 

 

复制进程修改参数,添加 handlecollisions

map ming.t3, target   ming.t3,handlecollisions;

 

启动复制进程

start rep_mi01

 

GGSCI   (ORADB-8955.datadept.eastmoney.com.sh) 79> stats REP_MI01,table   ming.t3,total

 

Sending STATS request to REPLICAT REP_MI01   ...

 

Start of Statistics at 2018-10-23   14:53:21.

 

Replicating from MING.T3 to MING.T3:

 

*** Total statistics since 2018-10-23   14:53:03 ***

          Total inserts                                      0.00

          Total updates                                        0.00

          Total deletes                                      1.00

          Total discards                                     0.00

          Total operations                                   1.00

          Total delete collisions                              1.00

 

End of Statistics

 

 

Update 实验

去掉 handlecollisions 参数,源端插入数据抽取进程并跳过这些差异数据。

 

源端

SQL> select * from t3;

 

           A EUTIME                   B

---------- --------------- ----------

           1                          3

           2 22-OCT-18                3

           3 22-OCT-18                3

           5 23-OCT-18                3

           6 23-OCT-18                3

           4 23-OCT-18                3

 

6 rows selected.

 

 

目标端

SQL> select * from t3;

 

           A EUTIME                   B

---------- --------------- ----------

           1                          3

           2 22-OCT-18                3

           3 22-OCT-18                3

 

3 rows selected.

 

 

 

源端 update 一条数据并提交:

SQL> update t3 set a=7,b=4 where a=6;

 

 

 

目标端复制进程 abend

2018-10-23 15:06:20  WARNING OGG-01004  Aborted grouped transaction on 'MING.T3',   Database error 1403 (OCI Error ORA-01403: no data found, SQL <UPDATE   "MING"."T3" x SET x."A" = :a3,x."EU

TIME" = :a4,x."B" = :a5   WHERE x."A" = :b0>).

 

2018-10-23 15:06:20  WARNING OGG-01003  Repositioning to rba 5635 in seqno 7.

 

2018-10-23 15:06:20  WARNING OGG-01154  SQL error 1403 mapping MING.T3 to MING.T3   OCI Error ORA-01403: no data found, SQL <UPDATE   "MING"."T3" x SET x."A" =   :a3,x."EUTIME" = :a4,x."B" = :

a5 WHERE x."A" = :b0>.

 

Source Context :

    SourceModule            :   [er.errors]

    SourceID                :   [/scratch/aime/adestore/views/aime_adc4150330/oggcore/OpenSys/src/app/er/errors.cpp]

    SourceFunction          :   [take_rep_err_action]

    SourceLine              : [941]

    ThreadBacktrace         : [15]   elements

                          :   [/u01/app/oracle/products/ogg/libgglog.so(CMessageContext::AddThreadContext()+0x1b)   [0x7f552516e4eb]]

                          :   [/u01/app/oracle/products/ogg/libgglog.so(CMessageFactory::CreateMessage(CSourceContext*,   unsigned int, ...)+0x135) [0x7f55251685c5]]

                          :   [/u01/app/oracle/products/ogg/libgglog.so(_MSG_ERR_MAP_TO_TANDEM_FAILED(CSourceContext*,   ggs::gglib::ggapp::CQualDBObjName<(DBObjType)1> const&,   ggs::gglib::g

gapp::CQualDBObjName<(DBObjType)1>   const&, CMessageFactory::MessageDisposition)+0x50) [0x7f5525161c7c]]

                          :   [/u01/app/oracle/products/ogg/replicat(take_rep_err_action(short, int, char   const*, extr_ptr_def*, std_rec_hdr_def*, char*, file_def*, bool)+0x17aa)   [0x5b63ef

]]

                          :   [/u01/app/oracle/products/ogg/replicat(replicate_io(ggs::gglib::ggdatasource::DataSource*,   file_def*, ggs::gglib::gglcr::CommonLCR const*, ggs::gglib::gglcr::

CommonLCR*, extr_ptr_def*, int*,   int)+0x3847) [0x63ad27]]

                          :   [/u01/app/oracle/products/ogg/replicat(process_record(ggs::gglib::ggdatasource::DataSource*,   file_def*&, ggs::gglib::gglcr::CommonLCR const*, ggs::gglib::gglc

r::CommonLCR*, short&,   extr_ptr_def*&, extr_ptr_def*&, int&, int&, int&,   bool)+0x2f8) [0x63f018]]

                          :   [/u01/app/oracle/products/ogg/replicat(ggs::er::ReplicatContext::processReplicatLoop(ggs::Heartbeat::MapGeneratorParams&)+0x1061)   [0x5f6cc1]]

                          :   [/u01/app/oracle/products/ogg/replicat(ggs::er::ReplicatContext::run(ggs::Heartbeat::MapGeneratorParams&)+0x29)   [0x5eae39]]

                          :   [/u01/app/oracle/products/ogg/replicat() [0x633c7b]]

                          :   [/u01/app/oracle/products/ogg/replicat(ggs::gglib::MultiThreading::MainThread::ExecMain()+0x60)   [0x6ecbe0]]

                          :   [/u01/app/oracle/products/ogg/replicat(ggs::gglib::MultiThreading::Thread::RunThread(ggs::gglib::MultiThreading::Thread::ThreadArgs*)+0x14d)   [0x6edbfd]]

                          :   [/u01/app/oracle/products/ogg/replicat(ggs::gglib::MultiThreading::MainThread::Run(int,   char**)+0xb1) [0x6edce1]]

                          :   [/u01/app/oracle/products/ogg/replicat(main+0x3b) [0x636c9b]]

                          :   [/lib64/libc.so.6(__libc_start_main+0xfd) [0x37cba1ed1d]]

                          :   [/u01/app/oracle/products/ogg/replicat() [0x56c559]]

 

2018-10-23 15:06:20  ERROR     OGG-01296  Error mapping from   MING.T3 to MING.T3.

 

 

 

复制进程添加

map ming.t3, target   ming.t3,handlecollisions;

 

开启复制进程

start rep_mi01

 

 

handlecollisions 变 update 为 insert 了

SQL> select * from t3;

 

           A EUTIME                   B

---------- --------------- ----------

           1                          3

           2 22-OCT-18                3

           3 22-OCT-18                3

           7 23-OCT-18                4

 

4 rows selected.

 

 

Insert 实验

目标端插入一条数据并提交

SQL> insert into t3(a,b) values(9,9);

 

 

源端插入主键为 9 的数据

SQL> insert into t3(a) values(9);

SQL> commit;

SQL> select * from t3;

 

           A EUTIME                   B

---------- --------------- ----------

           1                          3

           2 22-OCT-18                3

           3 22-OCT-18                3

           5 23-OCT-18                4

           7 23-OCT-18                4

           4 23-OCT-18                3

           8 23-OCT-18                3

           9 23-OCT-18                3

 

8 rows selected.

 

 

目标端:

SQL> select * from t3;

 

           A EUTIME                   B

---------- --------------- ----------

           1                          3

           2 22-OCT-18                3

           3 22-OCT-18                3

           7 23-OCT-18                4

           5 23-OCT-18                4

           8 23-OCT-18                3

           9 23-OCT-18                3

 

7 rows selected.

 

目标端复制进程没有 abend ,旧的数据被覆盖,以源端为主。

 

去掉复制进程中的 handlecollisions ,源端插入数据

SQL> insert into t3(a,b)   values(10,10);

SQL> commit;

 

 

源端插入数据并提交

SQL>    insert into t3(a) values(10);

 

 

源端进程 abend

2018-10-23 15:36:46  WARNING OGG-00869  OCI Error ORA-00001:  (MING. (status = 1), SQL <INSERT INTO   "MING"."T3" ("A","EUTIME","B")   VALUES (:a0,:a1,:a2)>.

 

2018-10-23 15:36:46  WARNING OGG-01004  Aborted grouped transaction on 'MING.T3',   Database error 1 (OCI Error ORA-00001:    (MING. (status = 1), SQL <INSERT INTO   "MING"."T3" ("A","EUTIME",

"B") VALUES (:a0,:a1,:a2)>).

 

2018-10-23 15:36:46  WARNING OGG-01003  Repositioning to rba 6366 in seqno 7.

 

2018-10-23 15:36:46  WARNING OGG-01154  SQL error 1 mapping MING.T3 to MING.T3 OCI   Error ORA-00001:  (MING. (status = 1),   SQL <INSERT INTO "MING"."T3"   ("A","EUTIME","B") VALUES (:a0,:a1,

:a2)>.

 

Source Context :

    SourceModule            :   [er.errors]

    SourceID                :   [/scratch/aime/adestore/views/aime_adc4150330/oggcore/OpenSys/src/app/er/errors.cpp]

    SourceFunction          :   [take_rep_err_action]

    SourceLine              : [941]

    ThreadBacktrace         : [15]   elements

                          :   [/u01/app/oracle/products/ogg/libgglog.so(CMessageContext::AddThreadContext()+0x1b)   [0x7f118d26c4eb]]

                          :   [/u01/app/oracle/products/ogg/libgglog.so(CMessageFactory::CreateMessage(CSourceContext*,   unsigned int, ...)+0x135) [0x7f118d2665c5]]

                          :   [/u01/app/oracle/products/ogg/libgglog.so(_MSG_ERR_MAP_TO_TANDEM_FAILED(CSourceContext*,   ggs::gglib::ggapp::CQualDBObjName<(DBObjType)1> const&,   ggs::gglib::g

gapp::CQualDBObjName<(DBObjType)1>   const&, CMessageFactory::MessageDisposition)+0x50) [0x7f118d25fc7c]]

                          :   [/u01/app/oracle/products/ogg/replicat(take_rep_err_action(short, int, char   const*, extr_ptr_def*, std_rec_hdr_def*, char*, file_def*, bool)+0x17aa)   [0x5b63ef

]]

                          :   [/u01/app/oracle/products/ogg/replicat(replicate_io(ggs::gglib::ggdatasource::DataSource*,   file_def*, ggs::gglib::gglcr::CommonLCR const*, ggs::gglib::gglcr::

CommonLCR*, extr_ptr_def*, int*,   int)+0x3847) [0x63ad27]]

                          : [/u01/app/oracle/products/ogg/replicat(process_record(ggs::gglib::ggdatasource::DataSource*,   file_def*&, ggs::gglib::gglcr::CommonLCR const*, ggs::gglib::gglc

r::CommonLCR*, short&,   extr_ptr_def*&, extr_ptr_def*&, int&, int&, int&,   bool)+0x2f8) [0x63f018]]

                            :   [/u01/app/oracle/products/ogg/replicat(ggs::er::ReplicatContext::processReplicatLoop(ggs::Heartbeat::MapGeneratorParams&)+0x1061)   [0x5f6cc1]]

                          :   [/u01/app/oracle/products/ogg/replicat(ggs::er::ReplicatContext::run(ggs::Heartbeat::MapGeneratorParams&)+0x29)   [0x5eae39]]

                          :   [/u01/app/oracle/products/ogg/replicat() [0x633c7b]]

                          :   [/u01/app/oracle/products/ogg/replicat(ggs::gglib::MultiThreading::MainThread::ExecMain()+0x60)   [0x6ecbe0]]

                          :   [/u01/app/oracle/products/ogg/replicat(ggs::gglib::MultiThreading::Thread::RunThread(ggs::gglib::MultiThreading::Thread::ThreadArgs*)+0x14d)   [0x6edbfd]]

                          :   [/u01/app/oracle/products/ogg/replicat(ggs::gglib::MultiThreading::MainThread::Run(int,   char**)+0xb1) [0x6edce1]]

                          :   [/u01/app/oracle/products/ogg/replicat(main+0x3b) [0x636c9b]]

                          :   [/lib64/libc.so.6(__libc_start_main+0xfd) [0x37cba1ed1d]]

                          :   [/u01/app/oracle/products/ogg/replicat() [0x56c559]]

 

2018-10-23 15:36:46  ERROR     OGG-01296  Error mapping from   MING.T3 to MING.T3.

 

 

 

再次加入 handlecollisions 参数,目标端数据被修改为与源端一致。

 

 

总结

1.handlecollisions 是复制进程参数

2. 对于 delete 操作,无 handlecollisions 参数,源端 delete 一条数据,目标端没有符合要求,那么复制进程会 abend ;

有 handlecollisions 参数,复制进程不会 abend ,目标端会跳过 delete

3. 对于 update 操作,无 handlecollisions 参数,源端 update 一条数据,目标端没有符合要求,那么复制进程会 abend ;

有 handlecollisions 参数,复制进程不会 abend ,目标端将 update 变为 insert ,将数据插入目标端。

4. 对于 insert 操作,无 handlecollisions 参数,源端 insert 一条数据,目标端违反了唯一性约束,那么复制进程会 abend ;

有 handlecollisions 参数,复制进程不会 abend ,目标端将按照源端数据,修改目标端违反唯一性约束的数据。

 


您可能感兴趣的文档:

--结束END--

本文标题: ogg参数之handlecollisions

本文链接: https://lsjlt.com/news/46498.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
  • ogg参数之handlecollisions
    本文主要探讨 handlecollisions 参数的作用。   环境 ogg12c 版本。 源端目标端都在 a 列上有主键。   准...
    99+
    2024-04-02
  • ogg中关于handlecollisions的示例分析
    今天就跟大家聊聊有关ogg中关于handlecollisions的示例分析,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。handlecollisio...
    99+
    2024-04-02
  • OGG参数详解
    一直以来对oracle goldengate许多参数比较疑惑,正好在MOS看到这个文章,转载到BLOG,以备参考 Objective: This paper provides samp...
    99+
    2024-04-02
  • oracle goldengate报错解决之OGG-00446、OGG-00529、OGG-00014
    OGG测试:无法启动ext进程,报错OGG-00446报错日志【截取重要部分】2016-10-28 16:51:40  ERROR   OGG-0...
    99+
    2024-04-02
  • 如何用python生成ogg的mapcol参数
    今天就跟大家聊聊有关如何用python生成ogg的mapcol参数,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。源表和目标表结构不一致,源表列比目标表多。1 需要配对的列名称:LIS...
    99+
    2023-06-04
  • OGG安装之oracle2oracle
    两台服务器都需要创建ogg操作系统用户(此步骤非必须,也可以使用ORACLE用户安装)。useradd -u 1003 -g oinstall -G dba oggpasswd ogg su - oggvi...
    99+
    2024-04-02
  • MySQL参数之lower_case_table_names
    lower_case_table_names 参数MySQL 库表 大小写,默认为00 库表敏感,区分大小写,指定的大小写保存文件1 库表不敏感,不区分大小写,文件系统以小写保存2 使用Create语句...
    99+
    2024-04-02
  • Oracle参数之cursor_sharing
    一、Cursor_sharing简介:这个参数是用来告诉Oracle在什么情况下可以共享游标,即SQL重用。Cursor_sharing参数有3个值可以设置:1)、EXACT:通常来说,exact值是Ora...
    99+
    2024-04-02
  • MGR参数之group_replication_member
    一、环境 MGR 8.0.17 三节点,roidb1、roidb2、roidb3 二、测试 1、默认group_replication_member_weight=50 2、设置roidb2的权重为100 ...
    99+
    2024-04-02
  • golang学习之路之函数可变参数
    可变参数的申明:sum(adds ... int ) int{   total:=_,add:=adds{     &n...
    99+
    2023-06-04
  • PXC集群参数之wsrep_on
    修改wsrep_on参数值为off,drop表,打开另一个会话,发现表依旧存在。这个参数的主要作用是控制当前结点的写入是不是要复制到其他节点。与MySQL的sql_log_bin很相似。测试过程如下: px...
    99+
    2024-04-02
  • LR之参数化学习
    以下是我学习时使用的代码//记录登录消耗时间lr_start_transaction("login");    web_reg_find("Text=test", &...
    99+
    2024-04-02
  • MySQL 参数浅析之 sql_log_bin
    有很多时候,我们会希望一条SQL语句只在Master数据库上执行,而不复制到Slave数据库,这时候,sql_log_bin这个参数就正是你需要的。例如,我们希望将数据只导入主库,但Slave数据库保持不变...
    99+
    2024-04-02
  • Python详解argparse参数模块之命令行参数
    目录前言示例一:最简参数对象示例二:整数求和示例三:文件是否被篡改自定义类型choices选项限定required必选参数子命令前言 help(argparse)查看说明文档,&ld...
    99+
    2024-04-02
  • python基础之 函数的参数
      一、形参和实参是什么  函数的参数分为形式参数和实际参数,简称形参和实参:  形参即在定义函数时,括号内声明的参数。形参本质就是一个变量名,用来接收外部传来的值。  def func(x,y): #x和y为形参  print(x,y) ...
    99+
    2023-06-01
  • OGG同步ORACLE数据到KAFKA
    环境:源端:oracle12.2 ogg for oracle 12.3目标端:KAFKA ogg for bigdata 12.3将oracle中的数据通过OGG同步到KAFKA 源...
    99+
    2024-04-02
  • C++核心编程之占位参数和默认参数
    目录1,默认参数2,函数占位参数1,默认参数 在c++中,函数的形参列表中的形参是可以有默认值的。 语法: 返回值类型 函数名 (参数 = 默认值)注意事项:1从左到右设置默认参数。...
    99+
    2024-04-02
  • ogg之replicat进程跳过事务的方法
    本文主要讲述: 1.ogg 如何跳过事务 2.logdump 在事务寻找中的关键作用   复制进程 abended GGSCI (ORALTDB.ea...
    99+
    2024-04-02
  • C++之默认参数详解
    目录一、C++ 默认参数1.举例1.单个参数2.多个参数2.规则总结一、C++ 默认参数 通常情况下,函数在调用时,形参从实参那里取得值。对于多次调用同一函数同一实参时,C++给出了...
    99+
    2024-04-02
  • Oracle+Ogg 归档丢失 重新导数据建立ogg同步步骤
    1031 ogg 恢复操作 1、在目标端停掉复制进程,删除目标端OGG的复制进程 ggsci>  dblogin userid ggtarget,password ggtarget ggsc...
    99+
    2024-04-02
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作