Oracle GoldenGate OGG 报错汇总(转)

1、IP限制因其的目标端拒绝源端进程

源端告警:view report ext_1

ERROR OGG-01201 Error reported by MGR : Access denied.
ERROR OGG-01668 PROCESS ABENDING.

目标端告警: view report mgr

INFO OGG-00963 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from EXTRACT on host [106.3..]:46817 (START REPLICAT REPINIT CPU -1 PRI -1 PARAMS ).
WARNING OGG-00936 Oracle GoldenGate Manager for Oracle, mgr.prm: Access denied (request from 172.41.176.102, rule #0).

解决:

可以看到是目标端mgr主动拒绝了源端extract启动replicat进程repinit。
后进过查询资料,这是由于GoldenGate 12.2的新特性导致的,要想可以通过远程启动目标端的replicat进程,需要在mgr配置文件中增加参数如下:
执行

GGSCI (custom04) 3> EDIT PARAMS MGR

添加

ACCESSRULE, PROG *, IPADDR 172.41.176.102 ALLOW

注意:IPADDR 后面IP是根绝Report mgr 面的IP填写

2、命令“MAP”未以分号结尾

源端告警:view report ext_1

ERROR OGG-00396 Command "MAP" not terminated by semi-colon

解决:

在目标服务器执行下面语句:

GGSCI (custom04) 3> EDIT PARAMS RINI_1

修改MAP命令,最后添加一个分号;

MAP marvin.*,TARGET mvschema. *;

3、无法打开检查点文件

源端警告 :view report ext_1

WARNING OGG-01194 Oracle GoldenGate Capture for Oracle, eini_1.prm: EXTRACT task RINI_1 abended : Could not open checkpoint file /home/oracle/ogg/ogg/dirchk/RINI_1.cpr, mode 1 (error 2, No such file or directory).

目标报错:

ERROR OGG-00446 Oracle GoldenGate Delivery for Oracle, rini_1.prm: Could not open checkpoint file /home/oracle/ogg/ogg/dirchk/RINI_1.cpr, mode 1 (error 2, No such file or directory).

解决:

在目标服务器执行下面语句:

GGSCI (custom04) 3> add replicat RINI_1,specialrun

4、数据库操作失败:无法连接到 ODBC

源端警告 :view report ext_1

OGG-01194 EXTRACT task RINI_1 abended : Database operation failed: Couldn't connect to EMP. ODBC error: SQLSTATE IM002 native

解决:在目标服务器执行如下语句
GGSCI (custom04) 3> EDIT PARAMS RINI_1

修改TARGETDB 为ODBC的连接字符串名称


 
Oracle GoldenGate OGG 报错汇总(转)_第1张图片
image.png

将原配置

TARGETDB EMP USERID sa, PASSWORD sa123456

修改为

TARGETDB Oracle USERID sa, PASSWORD sa123456

5、目标端未有同样表结构的数据表存在,导致无法进行数据同步

利用OGG进程数据初始化源端警告:view report ext_1

OGG-01194 EXTRACT task RINI_1 abended : Table mvschema.MARVIN does not exist in target database

原因:是由于目标端未有同样表结构的数据表存在,导致无法进行数据同步

解决:

1、源端获取建表DDL

SET SERVEROUTPUT ON
SET LINESIZE 1000
SET FEEDBACK OFF
set long 999999
SET PAGESIZE 1000
EXECUTE DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'STORAGE',false);
SELECT DBMS_METADATA.GET_DDL('TABLE','MARVIN','MARVIN') FROM DUAL; DBMS_METADATA.GET_DDL('TABLE','EMP_OGG','SCOTT') -------------------------------------------------------------------------------- CREATE TABLE "SCOTT"."EMP_OGG" ( "EMPNO" NUMBER(4,0), "ENAME" VARCHAR2(10), "JOB" VARCHAR2(9), "MGR" NUMBER(4,0), "HIREDATE" DATE, "SAL" NUMBER(7,2), "COMM" NUMBER(7,2), "DEPTNO" NUMBER(2,0), CONSTRAINT "PK_EMPNO_OGG" PRIMARY KEY ("EMPNO") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS TABLESPACE "JWT" ENABLE, SUPPLEMENTAL LOG GROUP "GGS_102724" ("EMPNO") ALWAYS, SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS, SUPPLEMENTAL LOG DATA (UNIQUE INDEX) COLUMNS, SUPPLEMENTAL LOG DATA (FOREIGN KEY) COLUMNS ) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING TABLESPACE "JWT" 

2、在目标端服务器数据库的SCHEME架构创建空表:(修改符合目标端数据库的语法)

use EMP
go
CREATE TABLE [MVSCHEMA].[EMP_OGG] ( [EMPNO] numeric(4,0), [ENAME] VARCHAR(10), [JOB] VARCHAR(9), [MGR] numeric(4,0), [HIREDATE] DATE, [SAL] numeric(7,2), [COMM] numeric(7,2), [DEPTNO]numeric(2,0), CONSTRAINT "PK_EMPNO_OGG" PRIMARY KEY ([EMPNO])) 

6、未指定数据源

源端告警:view report EORA_1

ERROR OGG-00041 Data source not specified.
ERROR OGG-01668 PROCESS ABENDING.

解决:
GGSCI (custom04) 3> EDIT PARAMS EORA_1
添加参数

EXTRACT EORA_1

7、不支持操作,因为“enable_goldengate_replication ”复制未设置为true

源端告警:VIEW REPORT EORA_1

ERROR OGG-02091 Operation not supported because enable_goldengate_replication is not set to true.
ERROR OGG-01668 PROCESS ABENDING

解决:
SQL> alter system set enable_goldengate_replication=true;
System altered.

8、Oracle重做线程数(2)与检查点线程数(1)不同

源端告警:VIEW REPORT EORA_1

ERROR OGG-00868 The number of Oracle redo threads (2) is not the same as the number of checkpoint threads (1). EXTRACT groups on RAC
systems should be created with the THREADS parameter (e.g., ADD EXT , TRANLOG, THREADS 2, BEGIN...).
ERROR OGG-01668 PROCESS ABENDING

解决:
GGSCI (custom04) 3>  delete extract EORA_1
Deleted EXTRACT EORA_2.

GGSCI (custom04) 3>   ADD EXTRACT EORA_1, TRANLOG, THREADS 2,BEGIN NOW EXTRACT added. 

9、访问不到asm上的日志

源端告警: VIEW REPORT EORA_1

ERROR OGG-00446 No valid log files for current redo sequence 3138, thread 1, error retrieving redo file name for sequence 3138, arch
ived = 0, use_alternate = 0Not able to establish initial position for begin time 2018-04-10 22:26:23.000000.
ERROR OGG-01668 PROCESS ABENDING.

解决:

这个是访问不到asm上的日志 抽取文件要加参数

TRANLOGOPTIONS DBLOGREADER

如下所示:

EXTRACT EORA_1
SETENV (NLS_LANG=AMERICAN_AMERICA.US7ASCII)
USERID [email protected]/orcl, PASSWORD ogg
EXTTRAIL /ogg/dirdat/mr

TRANLOGOPTIONS DBLOGREADER
TABLE marvin.*;

10、表字段结构不一致

源端告警: VIEW REPORT EORA_1

ERROR OGG-25127 Received an error reply requesting a graceful shutdown. (Reply received is 'GSOutput file c:/ogg//ogg/dirdat/pm00000
0 is not in any allowed output directories.'.).
ERROR OGG-01668 PROCESS ABENDING.

解决:

是由于PUMP进程参数文件中RMTTRAIL参数投递目标端Trail文件存放路径配置错误重新添加PUMP目标端Trail文件存放路径

GGSCI (rac2 as ogg@orcl2) 15> ADD RMTTRAIL C:/ogg/dirdat/pm, EXTRACT PORA_1, MEGABYTES 5
RMTTRAIL added.

2018-04-24 11:08:40 WARNING OGG-00869 OCI Error ORA-01400: cannot insert NULL into ("DAOXUN"."HK_REP_INPUT_PQ"."VAL") (status = 1400). INSERT INTO "DAOXUN"."HK_REP_INPUT_PQ" ("ID","MONDT","PQ","VAL") VALUES (:a0,:a1,:a2,:a3). 2018-04-24 11:08:41 WARNING OGG-01004 Aborted grouped transaction on 'DAOXUN.HK_REP_INPUT_PQ', Database error 1400 (OCI Error ORA-01400: cannot insert NULL into ("DAOXUN"."HK_REP_INPUT_PQ"."VAL") (status = 1400). INSERT INTO "DAOXUN"." HK_REP_INPUT_PQ" ("ID","MONDT","PQ","VAL") VALUES (:a0,:a1,:a2,:a3)). 2018-04-24 11:08:41 WARNING OGG-01003 Repositioning to rba 127906516 in seqno 30195. 2018-04-24 11:08:45 WARNING OGG-01154 SQL error 1400 mapping DAOXUN.HK_REP_INPUT_PQ to DAOXUN.HK_REP_INPUT_PQ OCI Error ORA-01400: cannot insert NULL into ("DAOXUN"."HK_REP_INPUT_PQ"."VAL") (status = 1400). INSERT INTO "DAOXUN"."HK_REP _INPUT_PQ" ("ID","MONDT","PQ","VAL") VALUES (:a0,:a1,:a2,:a3). 2018-04-24 11:08:45 WARNING OGG-01003 Repositioning to rba 130634745 in seqno 30195. Source Context : SourceModule : [er.errors] SourceID : [/scratch/aime1/adestore/views/aime1_adc4150256/oggcore/OpenSys/src/app/er/errors.cpp] SourceFunction : [take_rep_err_action] SourceLine : [623] ThreadBacktrace : [8] elements : [/home/ogg/libgglog.so(CMessageContext::AddThreadContext()+0x1e) [0x7f9f3894c7de]] : [/home/ogg/libgglog.so(CMessageFactory::CreateMessage(CSourceContext*, unsigned int, ...)+0x2cc) [0x7f9f38948c7c]] : [/home/ogg/libgglog.so(_MSG_ERR_MAP_TO_TANDEM_FAILED(CSourceContext*, ggs::gglib::ggapp::CQualDBObjName<(DBObjType)1> const&, ggs::gglib::ggapp::CQualDBObjName<(DBObjType)1> const&, CMessageFactory::MessageDis position)+0x53) [0x7f9f389417a9]] : [/home/ogg/replicat(take_rep_err_action(short, int, char const*, extr_ptr_def*, __std_rec_hdr*, char*, file_def*, bool)+0xdac) [0x51aff0]] : [/home/ogg/replicat(process_extract_loop()+0x2335) [0x5339d5]] : [/home/ogg/replicat(main+0x71a) [0x54588a]] : [/lib64/libc.so.6(__libc_start_main+0xfd) [0x3a2b61ed1d]] : [/home/ogg/replicat(__gxx_personality_v0+0x2fa) [0x4bbd6a]] 2018-04-24 11:08:45 ERROR OGG-01296 Error mapping from DAOXUN.HK_REP_INPUT_PQ to DAOXUN.HK_REP_INPUT_PQ 

查看资料,源端捕获进程开启FETCHOPTIONS FETCHPKUPDATECOLS将捕获完整的redo image镜像到trail中 这样保证插入完整的记录,然后去掉目标端的HANDLECOLLISIONS,因为update非主键列会有数据丢失但是两个操作我都操作过,重启进程还是报错...后来发现,是两边表"DAOXUN"."HK_REP_INPUT_PQ"."VAL"结构不同,VAL字段源端可为NULL,但目标端NOT NULL,
修改目标端VAL字段可为NULL即可.

SQL > ALTER TABLE DAOXUN.HK_REP_INPUT_PQ  MODIFY VAL NUMBER NULL;

11、目标端数据已存在,唯一约束导致新的insert报错

目标端告警:
2018-09-17 09:07:36 WARNING OGG-01154 SQL error 1 mapping DAOXUN.GDN to DAOXUN.GDN OCI Error ORA-00001: unique constraint (DAOXUN.PK_GDN) violated (stat us = 1). INSERT INTO "DAOXUN"."GDN" ("UNIT_ID","GDN_NUM","DELIV_MODE","FSCL_DELIV_MODE","RCV_UNIT_ID","RCV_WAREH_ID","RCV_FSCL_UNIT_ID","END_UNIT_ID","END _WAREH_ID","DELIV_MTHD","DELIV_PSTD","DELIV_ADDR","PICK_REQD","RCK_REQD","VEH_REQD","VWC_NUM","CNSN_REQD","CSB_NUM","FTCHR_ID","FTCH_ST_TIME","FTCH_FIN_TI ME","DLVR_ID","DELIV_TIME","CNGNR_ID","CNSN_TIME","PROGRESS","DELIV_PVN","DELIV_CTY","DELIV_DIST","RCVR_NAME","RCVR_TEL_NUM") VALUES (:a0,:a1,:a2,:a3,:a4, :a5,:a6,:a7,:a8,:a9,:a10,:a11,:a12,:a13,:a14,:a15,:a16,:a17,:a18,:a19,:a20,:a21,:a22,:a23,:a24,:a25,:a26,:a27,:a28,:a29,:a30). 

报错缘由:是因为目标端Insert的记录存在,并且有唯一性约束

解决方法:

参考链接:https://blog.csdn.net/u013820054/article/details/46740687

1.跳过当前事务
2.尝试加入 handlecollisions 参数解决该问题
3.尝试手动修复 target 上的数据
4.尝试加入REPERROR 参数 ignore这个错误
可以忽略掉重复数据的插入而其他类型的报错则abend
REPERROR (DEFAULT, ABEND)
REPERROR (-1, IGNORE)

当前采用的是第四种解决方法:

GGSCI (custom04) 3> edit params repl

添加如下:

REPERROR (DEFAULT, ABEND)
REPERROR (-1, IGNORE)

重启复制进程即可.....

12、SQL Server代理服务未启动

问题:

WARNING OGG-05265 Oracle GoldenGate Capture for SQL Server, EORA.prm: The SQL Agent on server WIN10 is not running. SQL Server CDC requires that the SQL Agent be running to capture change records.

解决

启动SQL Server 代理(MSSQLSERVER)

 
Oracle GoldenGate OGG 报错汇总(转)_第2张图片
启动代理

 

13、目标端不存在Delete记录

目标端告警:
2018-09-17 10:14:28 WARNING OGG-01004 Aborted grouped transaction on 'DAOXUN.WAREH_STK_PG', Database error 1403 (OCI Error ORA-01403: no data found, SQL "DAOXUN"."WAREH_STK_PG" WHERE "WAREH_ID" = :b0 AND "PROD_ID" = :b1 AND "STK_TYPE" = :b2 AND "DOC_TYPE" = :b3 AND "DOC_UNIT_ID" = :b4 AND "D OC_NUM" = :b5>). 2018-09-17 10:14:28 WARNING OGG-01003 Repositioning to rba 6520162 in seqno 55508. 2018-09-17 10:14:28 WARNING OGG-01154 SQL error 1403 mapping DAOXUN.WAREH_STK_PG to DAOXUN.WAREH_STK_PG OCI Error ORA-01403: no data found, SQL "DAOXUN"."WAREH_STK_PG" WHERE "WAREH_ID" = :b0 AND "PROD_ID" = :b1 AND "STK_TYPE" = :b2 AND "DOC_TYPE" = :b3 AND "DOC_UNIT_ID" = :b4 AND "DOC_NUM" = :b5>. 

报错缘由:
目标端不存在Delete记录,说明源端该记录并未同步到目标端,并且该表不存在附加日志

解决方法:

1、在参数中添加HANDLECOLLISIONS 当target端缺失delete 、update数据时,target端 自动处理,然后开启

2、停止replicat进程,先将要同步的表mapexclude,然后将在目标端上重新初始化此表,保证源和目标上此表的数据是一致,然后再在replicat进程中将表重新map,启动进程。

网上资料:
HANDLECOLLISIONS是我们使用goldengate过程中常有的一个REPLICAT参数,该参数依赖于主键或唯一索引处理冲突数据,常用于初始化阶段。对于无主键或唯一索引的表无法处理冲突,且可能导致重复记录。注意打开此参数则所有数据错误不管reperror如何配置均不再写discard文件,即所有数据冲突信息被默认规则处理,没有任何日志(则会忽略error mapping数据错误,而且不会报告到discard文件),因此日常复制不建议使用该参数;可予以考虑的特殊场景为只需新增数据,无需复制历史数据。
使用HANDLECOLLISIONS的几个场景:
1、target丢失delete记录(missing delete),忽略该问题并不记录到discardfile
2、target丢失update记录(missing update)
更新的键值是主键=》 update转换成INSERT ,默认情况下插入记录不完整
更新的键值是非主键=》 忽略该问题并不记录到discardfile
3、重复插入已存在的主键值到target表中,这将被replicat转换为UPDATE现有主键值的行的其他非主键列情景1 target丢失delete记录(missing delete) :

2018-09-18 17:26:19 ERROR OGG-00551 Database operation failed: Couldn't connect to sqlserver2012. ODBC error: SQLSTATE 37000 native database error 4060. [Microsoft][ODBC SQL Server Driver][SQL Server]无法打开登录所请求的数据库 "mark"。-登录失败。

这种错误提示非常的坑,不能按照字面意思去解决这个问题,无论修改odbc里面dsn的登陆还是sqlserver里面的授权都没用,而实际上在GGSCI里面同样的操作是没有问题的。
而解决这个问题的方法很简单:
打开Microsoft SQL Server Management Studio,在安全性->登录名->选择NT AUTHORITY/SYSTEM->右键->属性->服务器角色->勾选sysadmin就可以了
产生这个问题的原因在于GoldenGate的 manager(mgr)服务是以服务的方式运行的,在windows下是SYSTEM账户运行的,而SYSTEM账户可能没有权限访问Sql server数据库
另外一个是我们一般安装Sql server都选的混合模式,所以建立ODBC连接都是使用的集成账户登录

2018-09-18 17:31:11 ERROR OGG-01224 TCP/IP error 10061 (由于目标计算机积极拒绝,无法连接。), endpoint: 172.16.10.106:8088; retries exceeded.

这是因为目标端mgr进程未开启,开启目标端mgr进程,并重启源端mgr进程

2018-09-18 18:08:21 WARNING OGG-05300 The Oracle GoldenGate cleanup job and the SQL Server CDC cleanup job both exist on database mark. Ensure the SQL Server
CDC cleanup job is disabled to allow Oracle GoldenGate to manage CDC cleanup.

2018-09-18 18:08:21 ERROR OGG-05253 The SQL Server provider has thrown an exception. [mssqlcdcvam::MSSqlCDCCleanupMgr::Start] 对象名 'dbo.OracleGGCleanupJob
Status' 无效。 Additional Info : Error (-2147217865): 对象名 'dbo.OracleGGCleanupJobStatus' 无效。.

这是因为Sql server 2012 自带Cleanupjob 跟OGG版本12.2中的所冲突导致

参考MOS:ERROR OGG-05253 - Invalid object name 'goldengate.OracleGGCleanupJobStatus'. (文档 ID 2382734.1)

从SQL Server代理手动删除数据库的SQL Server cdc.dbname_cleanup作业。或者,您可以使用以下命令从源数据库中删除它

SQL > EXECUTE sys.sp_cdc_drop_job 'cleanup'

然后手动创建启动OGG job即可

SQL > ogg_cdc_cleanup_setup.bat createJob sa Qwer1234 mark WIN-8EMFLEJA45V dbo 

ogg_cdc_cleanup_setup.bat createJob 登录用户名 密码 源数据库 服务器名 Schema名

 

 

转载于:https://www.cnblogs.com/szone/articles/10989570.html

你可能感兴趣的:(Oracle GoldenGate OGG 报错汇总(转))