SQL> desc jack.t9 --源表 Name Null? Type ----------------------------------------- -------- ---------------------------- ID NUMBER NAME VARCHAR2(200) FID NUMBER SQL> desc jack.t9 --目标表 Name Null? Type ----------------------------------------- -------- ---------------------------- ID NUMBER NAME VARCHAR2(200) FID NUMBER AB NUMBER OWNER VARCHAR2(200) <<源OGG配置>> 1. extract进程参数 GGSCI (rac01) 4> view param lxjackt9 EXTRACT lxjackt9 ------------------------------------------ -- local extract for jack.t9 ------------------------------------------ SETENV (NLS_LANG=american_america.AL32UTF8) SETENV (ORACLE_SID=orcl) USERID ogg@orcl,PASSWORD ogg TRANLOGOPTIONS ASMUSER sys@ASM,ASMPASSWORD oracle EXTTRAIL /goldengate/dirdat/orcl/t9 TABLE jack.t9; #RAC源需要配置 ,threads 2表示有2个节点,单节点不用加threads 2 GGSCI(HOSTname) 1> add extract lxjackt9,threads 2,tranlog,begin now #添加抽取源文件位置和大小 GGSCI(Hostname) 2> add exttrail /goldengate/dirdat/t9,extract lxjackt9,megabytes 100 2. DataPump进程参数 GGSCI (rac01) 5> view param lpjackt9 EXTRACT lpjackt9 ---------------------------------------------- -- DataPump extract lpjack for jack.t9 ---------------------------------------------- USERID ogg@orcl,PASSWORD ogg NOPASSTHRU RMTHOST 192.168.31.113 MGRPORT 7809 RMTTRAIL /goldengate/dirdat/orcl/t9 TABLE jack.t9; #定义DataPump进程名,以及需要抽取的源trail文件位置/goldengate/dirdat/t9 GGSCI(Host) 1> add extract lpjack,exttrailsource /goldengate/dirdat/t9 #定义增加远程trail文件位置和远程trail文件大小 GGSCI(Host) 2> add rmttrail /goldengate/dirdat/t9,extract lpjack,megabytes 100 <<目标OGG配置>> 1. replicat进程参数 GGSCI (class113) 2> view param rejackt9 replicat rejackt9 ----------------------------- -- replicat for jack.t9 ----------------------------- USERID ogg@vmsys,password ogg HandleCollisions AssumeTargetDefs --此参数表示目标表与源表结构一致 Map jack.t9,Target jack.t9,colmap(USEDEFAULTS,owner="jack",ab=); 注意: 目标表中ab列为空,必须写在colmap最末尾后面 GGSCI(Hostname) 1> add replicat rejackt9,exttrail /goldengate/dirdat/t9