执行updatede时候源端报错OGG-01921 Missing GETBEFORECOLS with conflic...
gg version:Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBOdb:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
os:Red Hat Enterprise Linux Server release 6.0
目标端与源端的环境一致
extract参数GGSCI (ogg1) 2> view params EXMA1
extract exma1
SETENV (NLS_LANG = AMERICAN_AMERICA.AL32UTF8)
userid ogg_source ,password AADAAAAAAAAAAADAPBWBXBLIQCCAYDPDTCRHNBSHTGHIVDQDLDUENJHHMCSEWDLECINGACXBJERHZEFD &
AES128,ENCRYPTKEY mykey1
TRANLOGOPTIONS INCLUDEREGIONID ALTARCHIVELOGDEST PRIMARY /home/oracle/app/oradata/arch
EXTTRAIL /home/oracle/ogg/dirdat/m1
table clm.ma*,&
GETBEFORECOLS ( &
ON UPDATE ALL,&
ON DELETE ALL) &
;pump参数GGSCI (ogg1) 4> view params EXPMMA2
EXTRACT expmma2
REPORT AT 11:30
REPORTROLLOVER AT 17:00
USERID ogg_source, password AADAAAAAAAAAAADAPBWBXBLIQCCAYDPDTCRHNBSHTGHIVDQDLDUENJHHMCSEWDLECINGACXBJERHZEFD &
AES128,ENCRYPTKEY mykey1
DISCARDFILE /home/oracle/ogg/dirdat/disc_ma2.dis, append,megabytes 100
RMTHOST 192.168.146.11, MGRPORT 7809 ,ENCRYPT AES128, KEYNAME mykey2
ENCRYPTTRAIL AES128 KEYNAME mykey3
RMTTRAIL /home/oracle/ogg/dirdat/m2
TABLE clm.MAP_TAB,COLSEXCEPT(update_time);
--,&
--GETBEFORECOLS ( &
--ON UPDATE KEYINCLUDING (name, age), &
--ON DELETE KEYINCLUDING (name, age));replicat参数GGSCI (ogg2) 69> view params REMP1
REPLICAT remp1
--CHECKPARAMS
SETENV (NLS_LANG = AMERICAN_AMERICA.AL32UTF8)
USERID ogg_target, PASSWORD ogg
REPORT AT 11:30
REPORTROLLOVER AT 17:00
STATOPTIONS REPORTDETAIL RESETREPORTSTATS
sqlexec "Alter session set constraints=deferred"
---DBOPTIONS limitrows SUPPRESSTRIGGERS DEFERREFCONST
---DDLOPTIONS REPORT
---ASSUMETARGETDEFS
---REPERROR (DEFAULT, DISCARD)
---DDLERROR DEFAULT DISCARD RETRYOP
DECRYPTTRAIL AES128 KEYNAME mykey3
DISCARDFILE /home/oracle/ogg/disc_mp1,append, megabytes 100
SOURCEDEFS /home/oracle/ogg/dirdef/map.df
map clm.map_tab, target clm_target.map_tab_log, &
KEYCOLS (id), &
SQLEXEC(id env,query "select SYS_CONTEXT('USERENV','TERMINAL') terminal, sys.login_user username,SYS_CONTEXT('USERENV','HOST') hostn
ame,SYS_CONTEXT('USERENV','DB_NAME') dbname from dual",EXEC SOURCEROW), &
colmap (USEDEFAULTS, &
identity_card_en = IDENTITY_CARD, &
oper_time = @GETENV ("GGHEADER", "COMMITTIMESTAMP"), &
OPER_NAME = env.username , &
oper_ip = "test", &
oper_optype = @GETENV("GGHEADER", "OPTYPE") &
op_dname = env.dbname, &
op_terminal = env.terminal &
), &
COMPARECOLS ( &
ON UPDATE KEYINCLUDING (name, age), &
ON DELETE KEYINCLUDING (name, age)), &
RESOLVECONFLICT (UPDATEROWEXISTS, (DEFAULT, USEMAX(age))), &
RESOLVECONFLICT (INSERTROWEXISTS, (DEFAULT, USEMAX(age))), &
RESOLVECONFLICT (DELETEROWEXISTS, (DEFAULT, OVERWRITE)), &
RESOLVECONFLICT (UPDATEROWMISSING, (DEFAULT, OVERWRITE)), &
RESOLVECONFLICT (DELETEROWMISSING, (DEFAULT, DISCARD)), &
----REPERROR DISCARD, &
where (id=1),&
EVENTACTIONS ( SHELL ("Timestamp: $1 > /home/oracle/id=1log.txt ", VAR $1 = @GETENV("JULIANTIMESTAMP")),&
FILTER( IGNORE UPDATE, IGNORE DELETE,(area="yantai"))
;现在的现象是,insert进去没有问题,但是当update的时候replicat直接abend
2007-08-08 11:57:01 ERROR OGG-01921 Missing GETBEFORECOLS with conflict detection enabled in target table CLM_TARGET.MAP_TAB_LOG
.
不知道那个地方配置出问题了,多谢解答 目标端map_tab表的定义SYS@orcl(ogg1)> select dbms_metadata.get_ddl('TABLE','MAP_TAB','CLM') from dual;
DBMS_METADATA.GET_DDL('TABLE','MAP_TAB','CLM')
--------------------------------------------------------------------------------
CREATE TABLE "CLM"."MAP_TAB"
( "ID" NUMBER,
"NAME" VARCHAR2(20),
"AGE" NUMBER,
"IDENTITY_CARD" VARCHAR2(20),
"AREA" VARCHAR2(40),
"GANDER" NUMBER,
"UPDATE_TIME" TIMESTAMP (6) DEFAULT sysdate,
SUPPLEMENTAL LOG GROUP "GGS_77044" ("ID", "NAME", "AGE", "IDENTITY_CARD", "ARE
A", "GANDER", "UPDATE_TIME") ALWAYS
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS"
源端map_tab_log表定义SYS@orcl(ogg2)> select dbms_metadata.get_ddl('TABLE','MAP_TAB_LOG','CLM_TARGET') from dual;
DBMS_METADATA.GET_DDL('TABLE','MAP_TAB_LOG','CLM_TARGET')
--------------------------------------------------------------------------------
CREATE TABLE "CLM_TARGET"."MAP_TAB_LOG"
( "ID" NUMBER,
"NAME" VARCHAR2(20),
"AGE" NUMBER,
"AREA" VARCHAR2(40),
"IDENTITY_CARD_EN" VARCHAR2(100),
"GANDER" NUMBER,
"OPER_NAME" VARCHAR2(10),
"OPER_IP" VARCHAR2(40),
"OPER_OPTYPE" VARCHAR2(20),
"OPER_TIME" TIMESTAMP (6),
"OP_DNAME" VARCHAR2(20),
"OP_TERMINAL" VARCHAR2(40)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS"
表上都不添加主键。
页:
[1]