温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

goldengate基于表复制

发布时间:2020-08-13 11:38:15 来源:ITPUB博客 阅读:219 作者:luckyfriends 栏目:关系型数据库
本文是基于表复制设置。至于goldengate的安装配置,及基于用户的配置,请参阅《goldengate部署实施案例》
1、在源端主进程配置

添加主进程

GGSCI (ggate1) 2> edit params mgr


PORT 7809
PURGEOLDEXTRACTS /oracle/ggate/dirdat/mytest_xiuj/ex*, USECHECKPOINTS, MINKEEPDAYS 7


登录到数据库
GGSCI (ggate1) 3> dblogin userid ggate,password ggate
Successfully logged into database.

GGSCI (ggate1) 4> start mgr

2、配置抽了进程

GGSCI (ggate1) 13> add trandata mytest.mytest_xiuj

Logging of supplemental redo data enabled for table MYTEST.MYTEST_XIUJ.

GGSCI (ggate1) 14> add extract exiuj,tranlog,begin now
EXTRACT added.

GGSCI (ggate1) 15> add exttrail /oracle/ggate/dirdat/mytest_xiuj/ex,extract exiuj
EXTTRAIL added.


GGSCI (ggate1) 17> edit params exiuj

extract exiuj
userid ggate,password ggate
exttrail /oracle/ggate/dirdat/mytest_xiuj/ex
table mytest.mytest_xiuj;


3、配置传输进程

GGSCI (ggate1) 23> add extract pxiuj,exttrailsource /oracle/ggate/dirdat/mytest_xiuj/ex
EXTRACT added.


GGSCI (ggate1) 24> add rmttrail /u01/app/ggate/dirdat/mytest_xiuj/re,extract pxiuj
RMTTRAIL added.


GGSCI (ggate1) 25> edit params pxiuj


extract pxiuj
rmthost 192.168.92.191,mgrport 7809
passthru
rmttrail /u01/app/ggate/dirdat/mytest_xiuj/re
table mytest.mytest_xiuj;

4、配置复制进程

GGSCI (ggate2) 3> dblogin userid ggate,password ggate
Successfully logged into database.

GGSCI (ggate2) 4> add checkpointtable chkxiuj

Successfully created checkpoint table CHKxiuj.

GGSCI (ggate2) 5> add replicat rxiuj,exttrail /u01/app/ggate/dirdat/mytest_xiuj/re,checkpointtable chkxiuj
REPLICAT added.

GGSCI (ggate2) 6> edit params rxiuj

replicat rxiuj
setenv ( NLS_LANG = "SIMPLIFIED CHINESE_CHINA.UTF8")                    --注意,本处不能少,因为目标端与源端字符集不同
assumetargetdefs
HANDLECOLLISIONS
userid ggate,password ggate
discardfile /u01/app/ggate/dirdat/mytest_xiuj/rep1_discard.txt, append, megabytes 10
map mytest.mytest_xiuj, target receiver.mytest_xiuj;

--说明:
 
在配置goldengate时,要确定源端与目标端的字符集是否相同
通过:
SQL> select userenv('language') from dual;
 
USERENV('LANGUAGE')
----------------------------------------------------
SIMPLIFIED CHINESE_CHINA.ZHS16GBK

而源端为:"SIMPLIFIED CHINESE_CHINA.UTF8",使目标端与源端相同,否则在目标端,会出现乱码。所以在复制进程中必须加一段设置环境的值:setenv ( NLS_LANG = "SIMPLIFIED CHINESE_CHINA.UTF8")

查询导出字符集
select * from database_properties where property_name = 'NLS_CHARACTERSET'

相关视图及表
nls_database_parameters    props$   v$nls_parameters

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI