标签:
准备操作系统用户和文件系统
源库的准备
目标库的准备
软件安装(源和目标)
Mgr进程配置 (源和目标):
port 7809 --DYNAMICPORTLIST 7820-7830, 7833, 7835 --autostart er * --autorestart er *, retries 5, waitminutes 3 --purgeoldextracts /u01/oracle/goldengate/dirdat/*,usecheckpoints, minkeepdays 7
添加表级附加日志(源):
添加抽取进程(源):
抽取进程直接到目标端(源):
配置传输进程(源):
GGSCI> add exttrail /u01/oracle/goldengate/dirdat/la, ext exta, MEGABYTES 20
GGSCI> add extract dpea, EXTTRAILSOURCE /u01/oracle/goldengate/dirdat/la
GGSCI> add rmttrail /u01/oracle/goldengate/dirdat/ra, ext dpea, MEGABYTES 20
配置抽取进程参数(源):
GGSCI>edit param exta EXTRACT exta setenv(NLS_LANG = AMERICAN_AMERICA.AL32UTF8) setenv(ORACLE_SID = oggsource) USERID goldengate, PASSWORD goldengate rmthost oggtarget, mgrport 7809 rmttrail /u01/oracle/goldengate/dirdat/ra dynamicresolution --GETUPDATEBEFORES --NOCOMPRESSDELETES table myschema.maytable1; table myschema.maytable2; --table myschema.*; --TABLE hq.acct, COLS (col1, col3); --TABLE hq.acct, COLSEXCEPT (col4);
GGSCI>edit param exta EXTRACT exta setenv ( NLS_LANG = AMERICAN_AMERICA.ZHS16GBK ) setenv (ORACLE_SID = oggsource) USERID goldengate, PASSWORD goldengate EXTTRAIL /u01/oracle/goldengate/dirdat/la dynamicresolution --GETUPDATEBEFORES --NOCOMPRESSDELETES table myschema.maytable1; table myschema.maytable2; --table myschema.*; --TABLE hq.acct, COLS (col1, col3); //只复制该表的col1和col3列 --TABLE hq.acct, COLSEXCEPT (col4); //复制该表除col4外的所有列 --相比不使用data pump,其区别就是使用exttrail 代替了rmttrail,也无需再配置rmthost。
extract dpea setenv ( NLS_LANG = AMERICAN_AMERICA.ZHS16GBK ) passthru --REPORT AT 01:59 --reportrollover at 02:00 rmthost 99.16.1.11,mgrport 7809, compress rmttrail /oradata/goldengate/dirdat/ra dynamicresolution table myschema.mytable1; table myschema.mytable2; TABLE hq.acct; //注意此时不用再过滤cols了。 --其中:passthru表示本进程是一个传输进程data pump,无需跟数据库交互,只需要搬运数据即可; --因为data pump要传输数据到目标,所以需要配置rmthost和rmttrail指定目标主机和队列信息
启动源端进程(源):
投递进程配置(目标)初始化目标表:
投递进程配置(目标端)– 添加投递进程:
GGSCI> add rep repa, exttrail /u01/oracle/goldengate/dirdat/ra, nodbcheckpoint
投递进程配置(目标端)– 配置投递进程参数:
GGSCI>edit param repa replicat repa setenv (NLS_LANG = ‘SIMPLIFIED CHINESE_CHINA.AL32UTF8‘) setenv (ORACLE_SID = GUTJ) userid goldengate, password ******** --REPORT AT 01:59 --reportrollover at 02:00 reperror default,abend discardfile /u01/oracle/goldengate/dirrpt/repa.dsc,append, megabytes 10 assumetargetdefs --allownoopupdates dynamicresolution --INSERTALLRECORDS map myschema.maytable, target myschema.maytable; map gy25500.F_09B201A_APPEND, target odiu.F_B201A_APPEND, COLMAP ( usedefaults , etltime = @GETENV ("GGHEADER", "COMMITTIMESTAMP"));
安装过程总结:
标签:
原文地址:http://www.cnblogs.com/alexweng/p/4449049.html