资源描述:
《ogg同步异构表的步骤》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、Ogg异构表的同步:第一步:使用defgen建立源端表定义文件(源端)1、编辑defgen文件(文件目录在./dirprm下)--editparamsdefgen编辑命令---defgen为文件名DEFSFILE/u01/app/ogg/11.0/dirdef/ru.def--ru为自定义的文件名称useridogguser,passwordogguser–-登录数据库的用户名和密码TABLEtest.CK_RUKMX;--需要同步到目标端的表TABLEtest.CK_UCBQ;TABLEtest.CK_FANXD;TABLEtest.CK_ZH
2、ENGCTK;TABLEtest.CK_PANDCY;TABLEtest.CK_JIUFD;2、执行defgen命令在ogg中的目录下运行以下命令--与运行./ggsci为同一目录./defgenparamfile./dirprm/defgen.prm--在dirdef目录下生成ru.def3、把源端生成的def文件ftp传输到目标端dirdef目录下第二步:在源端新建抽取和传输二个进程,步骤与之前非异构相同1、在源端新建ogg抽取进程EXTRACTEORA_2SETENV(NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)U
3、SERIDogguser,PASSWORDogguserEXTTRAIL./dirdat/a2TABLEtest.CK_RUKMX;TABLEtest.CK_UCBQ;TABLEtest.CK_FANXD;TABLEtest.CK_ZHENGCTK;TABLEtest.CK_PANDCY;TABLEtest.CK_JIUFD;2、在源端新建ogg传输进程EXTRACTPORA_2SETENV(NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)PASSTHRURMTHOSTmrhathdt02,MGRPORT7809RMTTRA
4、IL/u01/app/ogg/11.0/dirdat/r2TABLEtest.CK_RUKMX;第三步:在目标端新建入库进程,步骤与之前非异构相同,参数有所改变REPLICATRORA_2SETENV(NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)USERIDogguser,PASSWORDogguserHANDLECOLLISIONS--这个是异构的关键参数,ru.def是之前源端ftp传输过来的文件;SOURCEDEFS/u01/app/ogg/11.0/dirdef/ru.defDISCARDFILE/u01/app
5、/ogg/11.0/dirrpt/RINIa2.dsc,PURGEALLOWNOOPUPDATES--由于异构之间的同步,所以列标不同,因此必需写明双方字段之的映射MAPtest.CK_RUKMX,TARGETtest001.CK_LIUSZ,COLMAP(CAOZM=@IF((RUKLX="1"),"A01",@COLSTAT(NULL)),LINGJBH=LINGJBH,GONGYSDM=GONGYSDM,YAOHLLX=@COLSTAT(NULL),XIEHZT=@COLSTAT(NULL),LINGJSL=LINGJSL,DANW=Dan
6、w,BL=BLH,RUKSJ=RUKSJ,JIUFSJ=@COLSTAT(NULL),CHENGYSDM=CHENGYSDM,CANGKBH=CANGKBH,ZICKBH=ZICKBH,PICH=PICH,DINGDH=DINGDH,USERCENTER=USERCENTER,UTH=UTH,ELH=ELH,CHEJ=CHANX,CAIWRQ=EDIT_TIME,UAH=@COLSTAT(NULL),ZHANGH=@COLSTAT(NULL),KEHBH=@COLSTAT(NULL),MUDD=@COLSTAT(NULL),UCH=@COLSTA
7、T(NULL),XINCKBM=@COLSTAT(NULL),XINZCKBM=@COLSTAT(NULL),YIKID=@COLSTAT(NULL),USH=@COLSTAT(NULL),XINUSH=@COLSTAT(NULL),KUWBH=@COLSTAT(NULL),XINKWBM=@COLSTAT(NULL),CREATOR="interface",CREATE_TIME=@COLSTAT(NULL),EDITOR=@COLSTAT(NULL),EDIT_TIME=@COLSTAT(NULL));MAPtest.CK_USBQ,TARG
8、ETtest001.CK_LIUSZ,COLMAP(CAOZM="A01S",LINGJBH=LINGJBH,GONGYSDM=GONG