码迷,mamicode.com
首页 > 其他好文 > 详细

配置增量刷新偶遇ERROR OGG-01163

时间:2018-01-07 00:50:36      阅读:448      评论:0      收藏:0      [点我收藏+]

标签:出现   tab   over   mfile   check   getenv   rem   思路   body   

1.从源端拷贝表定义语句,在目标端执行,确保两边表定义一致,另外需要增加三个字段(INC_ID--记录序列值,ACP_TIME--记录接受时间,FLAG--记录操作类型)

2.在源端表增加补充日志trandata(因为源端已经有该表的抽取,所以该步骤可以省略)

3.目标端添加replicat进程

add replicat inccert,exttrail ./dirdat/cust11/la,checkpointtable OGGNEW.CHECKPOINT

4.编辑配置

REPLICAT inccert
setenv (NLS_LANG="AMERICAN_AMERICA.ZHS16GBK")
setenv (ORACLE_SID=xxoo)
setenv (ORACLE_HOME=/opt/oracle/product/11.2)
userid ogg, password xxoo

nohandlecollisions
checksequencevalue
discardrollover
assumetargetdefs
applynoopupdates
--getupdatebefores
reperror default, discard
discardfile /dat/dirrpt/rpcert_001.dsc, append, megabytes 1024
eofdelaycsecs 10
batchsql opsperbatch 2000

MAP CRM20.tb_pty_certif_id_var_info, TARGET test.INC_VAR_INFO,& 
INSERTALLRECORDS,& 
SQLEXEC (id tb_pty_certif_id_var_info, query "select test.SEQ_INC_INFO.nextval id from dual",noparams,ERROR RAISE),& 
SQLEXEC (id tb_pty_certif_id_var_infot,query "select sysdate id from dual",noparams,ERROR RAISE),& 
colmap (
FLAG=@CASE (@GETENV("GGHEADER","OPTYPE"), "UPDATE", "M", "ENSCRIBE COMPUPDATE", "M", "SQL COMPUPDATE", "M", "PK UPDATE", "M", "DELETE", "D", "INSERT", "A", "TRUN
CATE", "T"),& 
INC_ID=tb_pty_certif_id_var_info.id,& 
ACP_TIME=tb_pty_certif_id_var_infot.id,& 
IDENTITY=IDENTITY,&
GENDER=GENDER,&
BIRTHDAY=BIRTHDAY,&
NATIONALITY=NATIONALITY,&
ADDRESS=ADDRESS,&
SIGN_UNIT=SIGN_UNIT,&
DEGREE=DEGREE,&
CAREER=CAREER,&
ADDR_CD=ADDR_CD,&
ADDRESS_COUNT=ADDRESS_COUNT,&
LATN_ID=LATN_ID,&
NAME=NAME,&
CRT_DATE=CRT_DATE,&
PHOTO=PHOTO,&
DATA_SOURCE=DATA_SOURCE,&
CERT_ORG=CERT_ORG,&
EFF_DATE=EFF_DATE,&
EXP_DATE=EXP_DATE
);

5.目标端表添加自增序列

create sequence  crm40.SEQ_INC_INFO
minvalue 1
maxvalue 9999999999999999999999999999
start with 1
increment by 1
cache 2000;

6.起复制进行

alter REPLICAT inccert,begin now

启动后就append了,报错如下

ERROR   OGG-01163  Bad column length (8) specified for column GENDER in table test.INC_VAR_INFO, maximum allowable length is 5.

检查两边表的定义确实都是一致的,所以出现这个问题比较奇怪

解决思路:

在源端生成表的定义,并传送到目标端

$vi source.prm
defsfile ./dirdef/certif.def,purge userid ogg, PASSWORD xxoo table username.tablename;
$defgen paramfile source.prm

在目标端的配置文件中修改相应参数

--assumetargetdefs
sourcedefs ./dirdef/certif.def

重启复制进程后恢复正常

 

 

 

 

 

 

 

 

 

 

 

 

REPLICAT inccertsetenv (NLS_LANG="AMERICAN_AMERICA.ZHS16GBK")setenv (ORACLE_SID=odsb12)setenv (ORACLE_HOME=/opt/oracle/product/11.2)userid oggnew, password ogg#132
nohandlecollisionschecksequencevaluediscardrolloverassumetargetdefsapplynoopupdates--getupdatebeforesreperror default, discarddiscardfile /opt/ogg/dirrpt/rpcert_001.dsc, append, megabytes 1024eofdelaycsecs 10batchsql opsperbatch 2000

MAP CRM20.tb_pty_certif_id_var_info, TARGET crm40.INC_TB_PTY_CERTIF_ID_VAR_INFO,& INSERTALLRECORDS,& SQLEXEC (id tb_pty_certif_id_var_info, query "select crm40.SEQ_INC_TB_PTY_CIV_INFO.nextval id from dual",noparams,ERROR RAISE),& SQLEXEC (id tb_pty_certif_id_var_infot,query "select sysdate id from dual",noparams,ERROR RAISE),& colmap (FLAG=@CASE (@GETENV("GGHEADER","OPTYPE"), "UPDATE", "M", "ENSCRIBE COMPUPDATE", "M", "SQL COMPUPDATE", "M", "PK UPDATE", "M", "DELETE", "D", "INSERT", "A", "TRUNCATE", "T"),& INC_ID=tb_pty_certif_id_var_info.id,& ACP_TIME=tb_pty_certif_id_var_infot.id,& IDENTITY=IDENTITY,&GENDER=GENDER,&BIRTHDAY=BIRTHDAY,&NATIONALITY=NATIONALITY,&ADDRESS=ADDRESS,&SIGN_UNIT=SIGN_UNIT,&DEGREE=DEGREE,&CAREER=CAREER,&ADDR_CD=ADDR_CD,&ADDRESS_COUNT=ADDRESS_COUNT,&LATN_ID=LATN_ID,&NAME=NAME,&CRT_DATE=CRT_DATE,&PHOTO=PHOTO,&DATA_SOURCE=DATA_SOURCE,&CERT_ORG=CERT_ORG,&EFF_DATE=EFF_DATE,&EXP_DATE=EXP_DATE);

配置增量刷新偶遇ERROR OGG-01163

标签:出现   tab   over   mfile   check   getenv   rem   思路   body   

原文地址:https://www.cnblogs.com/tonnytangy/p/8215667.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!