ogg高版本到低版本同步

源端ogg版本:
[oracle@rac1 ogg]$ ggsci -v

Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.21 18343248 18541804_FBO
Linux, x64, 64bit (optimized), Oracle 11g on May  8 2014 23:38:49

Copyright (C) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
目标端ogg版本:
[oracle@single2 ggs]$ ggsci -v

Oracle GoldenGate Command Interpreter for Oracle
Version 11.1.1.1.5_09 16874907 OGGCORE_11.1.1.1.6_PLATFORMS_130611.2300_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Jun 12 2013 03:27:15

Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved.

正常配置:
源端:exthtl  dphtl
目标端:rephtl

起同步以后,目标端进程:
GGSCI (single2) 3> info all

Program     Status      Group       Lag           Time Since Chkpt

MANAGER     RUNNING                                           
REPLICAT    ABENDED     REPHTL      00:00:00      00:06:26 

检查报错:
GGSCI (single2) 5> view report rephtl
。。。
2017-06-01 02:34:10  ERROR   OGG-01332  File /ggs/dirdat/tl000000, with compatibility level 3, is not compatible with the current software version's compatib
ility level of 2. Modify the file writer's parameter file to generate the appropriate format using the FORMAT LEVEL 2 option.
。。。

搜索ogg官方文档E24874-01 :
OGG-01332: File {0}, with compatibility level {1,number,0}, is not compatible with
the current software version's compatibility level of {2,number,0}. Modify the
file writer's parameter file to generate the appropriate format using the
FORMAT LEVEL {2,number,0} option.
Cause: The version of the trail file and the version of the process that reads it
(Extract or Replicat) are not the same. The trail version must be the same as, or
older than, that of the reader process. LEVEL is an internal option that specifies a
compatibility level that is independent of the Oracle GoldenGate software version
and only changes if new functionality was added to a version that affects the trail
format. A value of 1 or greater specifies a format that is supported by Oracle
GoldenGate versions 10.0 and later. A value of 0 specifies a format that is
supported by Oracle GoldenGate versions prior to 10.0.
Action: Edit the parameter file to set the EXTFILE, EXTTRAIL, RMTFILE, or
RMTTRAIL parameter to 0 to write a trail that is backward compatibile with the
reader process. Next, issue the issue the ALTER EXTRACT comand with the
ETROLLOVER option in GGSCI. The rollover creates a new trail file in the
specified format. Start Extract to begin writing to the new trail file. For more
information, see the Oracle GoldenGate reference documentation for the trail or
file parameters.
也就是说,生成trail文件的版本必须必读取trail文件的版本相同或者更旧。根据提示,去查找ogg官方文档E27274-01:
FORMAT RELEASE <major>.<minor> :
Specifies the metadata format of the data that is sent by Extract to a
trail, a file, or (if a remote task) to another process. The metadata tells
the reader process whether the data records are of a version that it
supports. The metadata format depends on the version of the Oracle
GoldenGate process. Older Oracle GoldenGate versions contain
different metadata than newer ones.
◆ FORMAT is a required keyword.
◆ RELEASE specifies an Oracle GoldenGate release version. <major> is
the major version number, and <minor> is the minor version
number. Valid values are 9.0 through the current Oracle
GoldenGate version number. (If you use an Oracle GoldenGate
version that is earlier than 9.0, specify either 9.0 or 9.5.) The
release version is programatically mapped back to the appropriate
trail format compatibility level. The default is the current version
of the process that writes to this trail.
There is a dependency between FORMAT and the RECOVERYOPTIONS
parameter. When RECOVERYOPTIONS is set to APPENDMODE, FORMAT must
be set to RELEASE 10.0 or greater. When RECOVERYOPTIONS is set to
OVERWRITEMODE, FORMAT must be set to RELEASE 9.5 or less.
See Appendix 2 on page 562 for additional information about Oracle
GoldenGate trail file versioning and recovery modes

根据提示,在参数文件中涉及trail文件的加format release 11.1(ext及dp中),再次重新部署,目标端启动进程:
2017-06-01 03:46:43  WARNING OGG-00869  OCI Error ORA-26945: unsupported hint RESTRICT_ALL_REF_CONS (status = 26945), SQL <INSERT /*+ RESTRICT_ALL_REF_CONS *
/ INTO "TEST"."PK" ("ID","NAME") VALUES (:a0,:a1)>.

2017-06-01 03:46:43  WARNING OGG-01004  Aborted grouped transaction on 'TEST.PK', Database error 26945 (OCI Error ORA-26945: unsupported hint RESTRICT_ALL_RE
F_CONS (status = 26945), SQL <INSERT /*+ RESTRICT_ALL_REF_CONS */ INTO "TEST"."PK" ("ID","NAME") VALUES (:a0,:a1)>).

2017-06-01 03:46:43  WARNING OGG-01003  Repositioning to rba 328089 in seqno 0.

2017-06-01 03:46:43  WARNING OGG-01154  SQL error 26945 mapping TEST.PK to TEST.PK OCI Error ORA-26945: unsupported hint RESTRICT_ALL_REF_CONS (status = 2694
5), SQL <INSERT /*+ RESTRICT_ALL_REF_CONS */ INTO "TEST"."PK" ("ID","NAME") VALUES (:a0,:a1)>.

2017-06-01 03:46:43  WARNING OGG-01003  Repositioning to rba 328089 in seqno 0.

Source Context :
  SourceModule            : [er.main]
  SourceID                : [/scratch/aime1/adestore/views/aime1_adc4150267/oggcore/OpenSys/src/app/er/rep.c]
  SourceFunction          : [take_rep_err_action]
  SourceLine              : [16191]
  ThreadBacktrace         : [8] elements
                          : [/ggs/replicat(CMessageContext::AddThreadContext()+0x26) [0x68bab6]]
                          : [/ggs/replicat(CMessageFactory::CreateMessage(CSourceContext*, unsigned int, ...)+0x39f) [0x6853df]]
                          : [/ggs/replicat(_MSG_ERR_MAP_TO_TANDEM_FAILED(CSourceContext*, DBString<777> const&, DBString<777> const&, CMessageFactory::Messag
eDisposition)+0x4d) [0x66bf2d]]
                          : [/ggs/replicat() [0x552ab3]]
                          : [/ggs/replicat() [0x55d8cb]]
                          : [/ggs/replicat(main+0x65c) [0x54800c]]
                          : [/lib64/libc.so.6(__libc_start_main+0xfd) [0x3648e1ed1d]]
                          : [/ggs/replicat(__gxx_personality_v0+0x1ea) [0x4fd56a]]

2017-06-01 03:46:43  ERROR   OGG-01296  Error mapping from TEST.PK to TEST.PK.

注释掉rep进程中的DBOPTIONS DEFERREFCONST, SUPPRESSTRIGGERS,同步正常。

注:ORA-26945: unsupported hint RESTRICT_ALL_REF_CONS原因(摘自 1644272.1)
The issue is seen on OGG version 11.1 when using DBOPTIONS DEFERREFCONST parameter against Oracle DB version 11.2.0.4.
OGG version should be 11.2 or higher when using Oracle db version 11.2.0.4 and make sure to use the OGG build for Oracle 11g.

The error could also happen when ENABLE_GOLDENGATE_REPLICATION database parameter is not enabled on Oracle 11.2.0.4 and 12.1.0.2+


猜你喜欢

转载自blog.csdn.net/ghostliming/article/details/72830291