文档课题:搭建ogg双向复制时,oracle 19.16向oracle 10.2.0.4 ogg复制时报警OGG-01389、OGG-02246处理记录.标签:00,--,leo,RUNNING,oracle,ogg,EXTRACT,OGG From: https://blog.51cto.com/u_12991611/5938283
源 端:IP 192.168.133.103 数据库oracle 11.2.0.4 64位,实例名:orcl 主机名:leo-10g-ogg
目 标 端:IP 192.168.133.109 数据库oracle 19.16.0.0 64位,实例名:simdb 主机名:leo-19c-ogg
ogg 软件:
源 端:fbo_ggs_Linux_x64_ora10g_64bit.tar
目 标 端:191004_fbo_ggs_Linux_x64_shiphome.zip
1、测试效果
--源端与目标端进程情况.
GGSCI (leo-19c-ogg) 4> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DP1 00:00:00 00:02:52
EXTRACT RUNNING EXTA 00:00:00 00:00:03
REPLICAT RUNNING REP1 00:00:00 00:00:08
GGSCI (leo-10g-ogg) 11> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DP1 00:00:00 00:00:05
EXTRACT RUNNING EXTA 00:00:00 00:00:07
REPLICAT RUNNING REP1 00:00:00 00:00:01
--ogg双向复制搭建成功后,ddl测试如下:
[oracle@leo-10g-ogg ~]$ sqlplus scott/tiger@orcl
SQL*Plus: Release 10.2.0.4.0 - Production on Tue Dec 13 23:37:38 2022
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create table tedu as select * from dual;
Table created.
SQL> conn scott/tiger@simdb
Connected.
SQL> select count(*) from tedu;
COUNT(*)
----------
1
SQL> alter table tedu add name varchar2(20);
Table altered.
SQL> desc tedu
Name Null? Type
----------------------------------------- -------- ----------------------------
DUMMY VARCHAR2(1)
NAME VARCHAR2(20)
SQL> conn scott/tiger@orcl
Connected.
SQL> desc tedu
Name Null? Type
----------------------------------------- -------- ----------------------------
DUMMY VARCHAR2(1)
说明:可以看到simdb端修改字段长度后,在orcl端并没有相应的更新.
2、异常分析
--查orcl端进程
GGSCI (leo-10g-ogg) 7> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DP1 00:00:00 00:00:00
EXTRACT RUNNING EXTA 00:00:00 00:00:07
REPLICAT ABENDED REP1 00:00:00 13:38:17
说明:应用进程rep1异常停止.
日志如下:
2022-12-14 09:11:21 ERROR OGG-01389 File header failed to parse tokens. File ./dirdat/ta000002, last offset 469, data: 0x 1D5:
***********************************************************************
* ** Run Time Statistics ** *
***********************************************************************
Reading ./dirdat/ta000002, current RBA 0, 0 records
--主要报错“File header failed to parse tokens”
--查simdb端进程情况.
GGSCI (leo-19c-ogg) 17> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT ABENDED DP1 00:00:00 13:41:55
EXTRACT RUNNING EXTA 00:00:00 00:00:06
REPLICAT RUNNING REP1 00:00:00 00:00:08
说明:发现simdb端dp1投递进程异常停止.
日志如下:
2022-12-14 10:00:16 ERROR OGG-01031 There is a problem in the communication with the Collector/Receiver Server. (Reply received is 'File header failed to parse tokens. File ./dirdat/ta000002, last offset 4
--主要报错依然是“File header failed to parse tokens”.
3、解决过程
经查询资料,此为ogg版本不同造成,修改simdb端抓取、投递进程参数.
--停止两端进程.
GGSCI (leo-19c-ogg) 27> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
EXTRACT ABENDED DP1 00:00:00 14:02:35
EXTRACT STOPPED EXTA 00:00:00 00:00:18
REPLICAT STOPPED REP1 00:00:00 00:00:09
GGSCI (leo-10g-ogg) 7> info all
Program Status Group Lag Time Since Chkpt
MANAGER STOPPED
EXTRACT STOPPED DP1 00:00:00 00:00:02
EXTRACT STOPPED EXTA 00:00:00 00:00:16
REPLICAT ABENDED REP1 00:00:00 13:59:55
--orcl端ogg版本查看
[oracle@leo-10g-ogg ogg]$ ./ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.1.1.1 OGGCORE_11.1.1_PLATFORMS_110421.2040
Linux, x64, 64bit (optimized), Oracle 10g on Apr 21 2011 22:26:49
Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
--修改simdb端抓取、投递进程
--注意:虽然此处查的orcl端ogg版本为11.1,但添加时需要写12.2,测试过添加11.1后,启动exta进程告警如下:
[oracle@leo-19c-ogg dirrpt]$ cat EXTA.rpt
2022-12-14 14:19:48 ERROR OGG-02246 Source redo compatibility level 19.0.0 requires trail FORMAT 12.2 or higher.
2022-12-14 14:19:48 ERROR OGG-01668 PROCESS ABENDING.
--修改抓取进程
GGSCI (leo-19c-ogg) 30> view param exta
EXTRACT exta
setenv (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
setenv (ORACLE_SID=simdb)
setenv (ORACLE_HOME=/u01/app/oracle/product/19.3.0/db)
userid ogg@SIMDB,password ogg
GETTRUNCATES
REPORTCOUNT EVERY 30 MINUTES,RATE
numfiles 5000
DISCARDFILE ./dirrpt/exta_ss.dsc, APPEND, MEGABYTES 1024
DISCARDROLLOVER AT 3:00
WARNLONGTRANS 2h,CHECKINTERVAL 8m
--add format release 12.2
EXTTRAIL ./dirdat/ta, format release 12.2
NOCOMPRESSUPDATES
NOCOMPRESSDELETES
STATOPTIONS REPORTFETCH
DDL INCLUDE ALL
DDLOPTIONS ADDTRANDATA
DDLOPTIONS REPORT
TRANLOGOPTIONS EXCLUDEUSER ogg
table SCOTT.*;
--修改投递进程
GGSCI (leo-19c-ogg) 31> view param dp1
extract dp1
userid ogg@SIMDB,password ogg
setenv (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
passthru
rmthost 192.168.133.108,mgrport 7809
--add format release 12.2
rmttrail ./dirdat/ta, format release 12.2
table SCOTT.*;
--修改完成后先不启动抓取、投递进程,因为以前的trial文件是19.1版本,若此时启动会报错OGG-01411、OGG-01668.
--将抓取、投递进程切换一个新的trail文件.
GGSCI (leo-19c-ogg) 32> alter extract exta etrollover
2022-12-14 14:15:15 INFO OGG-01520 Rollover performed. For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file; it will not happen automatically.
EXTRACT altered.
GGSCI (leo-19c-ogg) 33> alter extract dp1 etrollover
2022-12-14 14:15:28 INFO OGG-01520 Rollover performed. For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file; it will not happen automatically.
EXTRACT altered.
GGSCI (leo-19c-ogg) 34> alter extract dp1 extseqno 000003
EXTRACT altered.
--simdb端开启进程:
GGSCI (leo-19c-ogg) 28> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DP1 00:00:00 00:00:05
EXTRACT RUNNING EXTA 00:00:00 00:00:08
REPLICAT RUNNING REP1 00:00:00 00:00:04
--orcl端开启应用进程
GGSCI (leo-10g-ogg) 9> start rep1
Sending START request to MANAGER ...
REPLICAT REP1 starting
GGSCI (leo-10g-ogg) 10> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DP1 00:00:00 00:00:05
EXTRACT RUNNING EXTA 00:00:00 00:00:08
REPLICAT ABENDED REP1 00:00:00 16:05:25
--应用进程异常,告警日志如下:
2022-12-14 16:17:44 ERROR OGG-01389 File header failed to parse tokens. File ./dirdat/ta000002, last offset 469
--解决.
GGSCI (leo-10g-ogg) 11> alter replicat rep1,extseqno 3,extrba 0
REPLICAT altered.
GGSCI (leo-10g-ogg) 12> start rep1
Sending START request to MANAGER ...
REPLICAT REP1 starting
GGSCI (leo-10g-ogg) 13> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DP1 00:00:00 00:00:05
EXTRACT RUNNING EXTA 00:00:00 00:00:04
REPLICAT RUNNING REP1 00:00:00 00:00:00
说明:成功开启ogg双向复制的所有进程.