ogg 表结构不一致同步 defgen

使用defgen 实现表结构不一致数据同步:
 
源端 和目标端 表结构不一样,用下面的方法实现:
 
源端
create table test_pri(id number primary key, name varchar2(10));
 
目标端:
create table test_pri(id number primary key);
 
 
源端 ggsci中
edit params defgen
 
defsfile /ogg/test_pri.p
userid ogg,password ogg
table song.test_pri;         --第一次这里没有加分号,报错
 
[oracle@localhost ogg]$ defgen paramfile /ogg/dirprm/defgen.prm 
 
***********************************************************************
        Oracle GoldenGate Table Definition Generator for Oracle
      Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230
   Linux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 05:08:19
 
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
 
 
                    Starting at 2013-08-22 16:17:36
***********************************************************************
 
Operating System Version:
Linux
Version #1 SMP Fri Jul 8 17:36:59 EDT 2011, Release 2.6.18-274.el5
Node: localhost.localdomain
Machine: x86_64
                         soft limit   hard limit
Address Space Size   :    unlimited    unlimited
Heap Size            :    unlimited    unlimited
File Size            :    unlimited    unlimited
CPU Time             :    unlimited    unlimited
 
Process id: 14869
 
***********************************************************************
**            Running with the following parameters                  **
***********************************************************************
defsfile /ogg/test_pri.p
userid ogg,password ***
table song.test_pri;
Retrieving definition for SONG.TEST_PRI
 
 
 
Definitions generated for 1 table in /ogg/test_pri.p
 
把文件拷到目标端 (ascii格式)
scp test_pri.p [email protected]:/ogg
 
 
源端 :
GGSCI (localhost.localdomain) 13> view params ext_1
 
 EXTRACT ext_1
SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
USERID ogg, PASSWORD ogg
EXTTRAIL ./dirdat/ex
TABLE song.test_pri;
 
GGSCI (localhost.localdomain) 14> view params pump_1
 
EXTRACT pump_1 
SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
PASSTHRU
RMTHOST ogg2, MGRPORT 7809 
RMTTRAIL ./dirdat/ta 
TABLE song.test_pri;
 
目标端 :
 
GGSCI (ogg2) 15> view params rep_1
 
REPLICAT rep_1 
SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK) 
USERID ogg, PASSWORD ogg 
--HANDLECOLLISIONS 
ASSUMETARGETDEFS 
RESTARTCOLLISIONS 
DISCARDFILE ./dirrpt/RTAB_aa.DSC, PURGE 
sourcedefs /ogg/test_pri.p
MAP song.*, TARGET song.*;

猜你喜欢

转载自andyniu.iteye.com/blog/2335092
ogg