Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

131

积分

1

好友

13

主题
1#
发表于 2013-4-15 15:16:19 | 查看: 6108| 回复: 3
gg version:Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
db:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
os:Red Hat Enterprise Linux Server release 6.0
目标端与源端的环境一致

extract参数
  1. GGSCI (ogg1) 2> view params EXMA1

  2. extract exma1
  3. SETENV (NLS_LANG = AMERICAN_AMERICA.AL32UTF8)
  4. userid ogg_source ,password AADAAAAAAAAAAADAPBWBXBLIQCCAYDPDTCRHNBSHTGHIVDQDLDUENJHHMCSEWDLECINGACXBJERHZEFD &
  5.         AES128,ENCRYPTKEY mykey1
  6. TRANLOGOPTIONS  INCLUDEREGIONID ALTARCHIVELOGDEST PRIMARY /home/oracle/app/oradata/arch
  7. EXTTRAIL /home/oracle/ogg/dirdat/m1
  8. table clm.ma*,&
  9. GETBEFORECOLS ( &
  10. ON UPDATE ALL,&
  11. ON DELETE ALL) &
  12. ;
复制代码
pump参数
  1. GGSCI (ogg1) 4> view params EXPMMA2

  2. EXTRACT expmma2
  3. REPORT AT 11:30
  4. REPORTROLLOVER AT 17:00
  5. USERID ogg_source,  password AADAAAAAAAAAAADAPBWBXBLIQCCAYDPDTCRHNBSHTGHIVDQDLDUENJHHMCSEWDLECINGACXBJERHZEFD &
  6.         AES128,ENCRYPTKEY mykey1
  7. DISCARDFILE /home/oracle/ogg/dirdat/disc_ma2.dis, append,megabytes 100
  8. RMTHOST 192.168.146.11, MGRPORT 7809 ,ENCRYPT AES128, KEYNAME mykey2
  9. ENCRYPTTRAIL AES128 KEYNAME mykey3
  10. RMTTRAIL /home/oracle/ogg/dirdat/m2
  11. TABLE  clm.MAP_TAB,COLSEXCEPT(update_time);
  12. --,&
  13. --GETBEFORECOLS ( &
  14. --ON UPDATE KEYINCLUDING (name, age), &
  15. --ON DELETE KEYINCLUDING (name, age));
复制代码
replicat参数
  1. GGSCI (ogg2) 69> view params REMP1

  2. REPLICAT remp1
  3. --CHECKPARAMS
  4. SETENV (NLS_LANG = AMERICAN_AMERICA.AL32UTF8)
  5. USERID ogg_target, PASSWORD ogg
  6. REPORT AT 11:30
  7. REPORTROLLOVER AT 17:00
  8. STATOPTIONS REPORTDETAIL RESETREPORTSTATS
  9. sqlexec "Alter session set constraints=deferred"
  10. ---DBOPTIONS limitrows  SUPPRESSTRIGGERS DEFERREFCONST
  11. ---DDLOPTIONS REPORT
  12. ---ASSUMETARGETDEFS
  13. ---REPERROR (DEFAULT, DISCARD)
  14. ---DDLERROR DEFAULT DISCARD  RETRYOP
  15. DECRYPTTRAIL AES128 KEYNAME mykey3
  16. DISCARDFILE /home/oracle/ogg/disc_mp1,append, megabytes 100
  17. SOURCEDEFS /home/oracle/ogg/dirdef/map.df
  18. map clm.map_tab, target  clm_target.map_tab_log, &
  19. KEYCOLS (id), &
  20. SQLEXEC(id env,query "select SYS_CONTEXT('USERENV','TERMINAL') terminal, sys.login_user username,SYS_CONTEXT('USERENV','HOST') hostn
  21. ame,SYS_CONTEXT('USERENV','DB_NAME') dbname from dual",EXEC SOURCEROW), &
  22. colmap (USEDEFAULTS, &
  23. identity_card_en = IDENTITY_CARD, &
  24. oper_time = @GETENV ("GGHEADER", "COMMITTIMESTAMP"), &
  25. OPER_NAME = env.username , &
  26. oper_ip = "test", &
  27. oper_optype = @GETENV("GGHEADER", "OPTYPE") &
  28. op_dname =  env.dbname, &
  29. op_terminal = env.terminal &
  30. ), &
  31. COMPARECOLS ( &
  32. ON UPDATE KEYINCLUDING (name, age), &
  33. ON DELETE KEYINCLUDING (name, age)), &
  34. RESOLVECONFLICT (UPDATEROWEXISTS, (DEFAULT, USEMAX(age))), &
  35. RESOLVECONFLICT (INSERTROWEXISTS, (DEFAULT, USEMAX(age))), &
  36. RESOLVECONFLICT (DELETEROWEXISTS, (DEFAULT, OVERWRITE)), &
  37. RESOLVECONFLICT (UPDATEROWMISSING, (DEFAULT, OVERWRITE)), &
  38. RESOLVECONFLICT (DELETEROWMISSING, (DEFAULT, DISCARD)), &
  39. ----REPERROR DISCARD, &
  40. where (id=1),&
  41. EVENTACTIONS ( SHELL ("Timestamp: $1  > /home/oracle/id=1log.txt ", VAR $1 = @GETENV("JULIANTIMESTAMP")),&
  42. FILTER( IGNORE UPDATE,  IGNORE DELETE,(area="yantai"))
  43. ;
复制代码
现在的现象是,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
.
不知道那个地方配置出问题了,多谢解答
2#
发表于 2013-4-15 15:25:38
目标端map_tab表的定义
  1. SYS@orcl(ogg1)> select dbms_metadata.get_ddl('TABLE','MAP_TAB','CLM') from dual;

  2. DBMS_METADATA.GET_DDL('TABLE','MAP_TAB','CLM')
  3. --------------------------------------------------------------------------------

  4.   CREATE TABLE "CLM"."MAP_TAB"
  5.    (    "ID" NUMBER,
  6.         "NAME" VARCHAR2(20),
  7.         "AGE" NUMBER,
  8.         "IDENTITY_CARD" VARCHAR2(20),
  9.         "AREA" VARCHAR2(40),
  10.         "GANDER" NUMBER,
  11.         "UPDATE_TIME" TIMESTAMP (6) DEFAULT sysdate,
  12.          SUPPLEMENTAL LOG GROUP "GGS_77044" ("ID", "NAME", "AGE", "IDENTITY_CARD", "ARE
  13. A", "GANDER", "UPDATE_TIME") ALWAYS
  14.    ) SEGMENT CREATION IMMEDIATE
  15.   PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
  16. NOCOMPRESS LOGGING
  17.   STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  18.   PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  19.   BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  20.   TABLESPACE "USERS"
复制代码
源端map_tab_log表定义
  1. SYS@orcl(ogg2)> select dbms_metadata.get_ddl('TABLE','MAP_TAB_LOG','CLM_TARGET') from dual;

  2. DBMS_METADATA.GET_DDL('TABLE','MAP_TAB_LOG','CLM_TARGET')
  3. --------------------------------------------------------------------------------

  4.   CREATE TABLE "CLM_TARGET"."MAP_TAB_LOG"
  5.    (    "ID" NUMBER,
  6.         "NAME" VARCHAR2(20),
  7.         "AGE" NUMBER,
  8.         "AREA" VARCHAR2(40),
  9.         "IDENTITY_CARD_EN" VARCHAR2(100),
  10.         "GANDER" NUMBER,
  11.         "OPER_NAME" VARCHAR2(10),
  12.         "OPER_IP" VARCHAR2(40),
  13.         "OPER_OPTYPE" VARCHAR2(20),
  14.         "OPER_TIME" TIMESTAMP (6),
  15.         "OP_DNAME" VARCHAR2(20),
  16.         "OP_TERMINAL" VARCHAR2(40)
  17.    ) SEGMENT CREATION IMMEDIATE
  18.   PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
  19. NOCOMPRESS LOGGING
  20.   STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  21.   PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  22.   BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  23.   TABLESPACE "USERS"
复制代码

回复 只看该作者 道具 举报

3#
发表于 2013-4-15 15:33:43
表上都不添加主键。

回复 只看该作者 道具 举报

4#
发表于 2013-4-15 15:34:43
REMP1.txt (15.97 KB, 下载次数: 587)

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-11-18 20:48 , Processed in 0.062170 second(s), 23 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569