龙空技术网

初始化同步表,源端抽取进程这个变化是否会同步到目标库中?

Java互联网领域 55

前言:

当前看官们对“java实验抽取样本”可能比较注意,小伙伴们都需要分析一些“java实验抽取样本”的相关资讯。那么小编也在网络上网罗了一些关于“java实验抽取样本””的相关知识,希望你们能喜欢,兄弟们一起来学习一下吧!

一、测试目标

疑问,OGG初始化同步表,源端抽取进程开始抽取的scn<源端事务的start_scn时,这个变化是否会同步到目标库中?
二、实验测试
如下进行测试!session 1SQL> conn yz/yzSQL> create table t1(id int,cc_name varchar2(20));SQL> insert into t1 values(1,'test');1 row created.OGG源端开始抽取t1表;GGSCI (t1 as ogg@t1) 10> add trandata yz.t12020-11-18 10:49:21  WARNING OGG-06439  No unique key is defined for table T1. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.2020-11-18 10:49:21  INFO    OGG-15130  No key found for table YZ.T1.  All viable columns will be logged.2020-11-18 10:49:21  WARNING OGG-00706  Failed to add supplemental log group on table YZ.T1 due to ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired SQL ALTER TABLE "YZ"."T1" ADD SUPPLEMENTAL LOG GROUP "GGS_89400" ("ID","CC_NAME") ALWAYS  /* GOLDENGATE_DDL_REPLICATION */. !测试有变!本次测试需要测试3个场景!已测试add trandata 是否存在影响!session1  源端非add trandata,目标端启动时不限制;session2  源端add trandata,目标端启动时不限制;session3  源端add trandata,目标端启动时限制;session 2SQL> conn yz/yzSQL> create table t2(id int,cc_name varchar2(20));GGSCI (t1 as ogg@t1) 11> add  trandata yz.t2SQL> insert into t2 values(1,'test');1 row created.session 3SQL> conn yz/yzSQL> create table t3(id int,cc_name varchar2(20));GGSCI (t1 as ogg@t1) 11> add  trandata yz.t3SQL> insert into t3 values(1,'test');1 row created.查询事务启动scnselect  s.sid,s.username,s.event,sql.sql_text,v.status,v.START_TIME,v.START_SCN from v$session s,v$TRANSACTION v,v$sql sql   where s.SADDR=v.SES_ADDR and s.PREV_SQL_ID=sql.sql_id;       SID USERNAME   EVENT                         SQL_TEXT                                 STATUS           START_TIME            START_SCN---------- ---------- ----------------------------- ---------------------------------------- ---------------- -------------------- ----------         1 YZ         SQL*Net message from client   insert into t1 values(1,'test')          ACTIVE           11/18/20 10:31:29       3571762        43 YZ         SQL*Net message from client   insert into t2 values(1,'test')          ACTIVE           11/18/20 11:00:25       3572598        46 YZ         SQL*Net message from client   insert into t3 values(1,'test')          ACTIVE           11/18/20 11:01:03       3572788SQL> select current_scn from v$database;CURRENT_SCN-----------    3573095    OGG源端开始抽取重启抽取进程投递一样追加!重启复制进程注意:本次测试需要!map yz.t1,target bak_yz.t1;map yz.t2,target bak_yz.t2;map yz.t3,target bak_yz.t3,filter(@GETENV('TRANSACTION','CSN')>3573095);目标端同步表结构[oracle@t2 ~]$ sqlplus bak_yz/yzSQL> create table t1(id int,cc_name varchar2(20));SQL> create table t2(id int,cc_name varchar2(20));SQL> create table t3(id int,cc_name varchar2(20));启动复制进程GGSCI (t2) 9> start repa此时,session 1,2,3都进行commit提交!SQL> select * from t1;        ID CC_NAME---------- --------------------         1 testSQL> select * from t2;        ID CC_NAME---------- --------------------         1 testSQL> select * from t3;        ID CC_NAME---------- --------------------         1 test???得出如下结论:1.OGG这个版本Version 19.1.0.0.4,OGG是根据事务结束scn来判断这个事务是否需要同步,不存在早期版本初始化同步scn < 源端start_scn时,存在数据不一致的问题!2.OGG同步的表即使不加add trandata 例如insert操作还是能正常捕获到记录并进行同步;当然某些情况无法获取数据同步update操作!(测试insert or delete正常)2020-11-18 11:26:36  WARNING OGG-01004  Aborted grouped transaction on BAK_YZ.T1, Database error 1403 (No data found).

标签: #java实验抽取样本