只列出基本基本配置。GG 的基本安装在此略过
首先必须生成oracle(源端)的表定义文件
先写好一个defgen文件,然后调用GG安装目录下的defgen生成
生成的定义文件如下:
*+- Defgen version 2.0, Encoding GBK
*
* Definitions created/modified 2013-07-17 09:37
*
* Field descriptions for each column entry:
*
* 1 Name
* 2 Data Type
* 3 External Length
* 4 Fetch Offset
* 5 Scale
* 6 Level
* 7 Null
* 8 Bump if Odd
* 9 Internal Length
* 10 Binary Length
* 11 Table Length
* 12 Most Significant DT
* 13 Least Significant DT
* 14 High Precision
* 15 Low Precision
* 16 Elementary Item
* 17 Occurs
* 18 Key Column
* 19 Sub Data Type
*
Database type: ORACLE
Character set ID: UTF-8
National character set ID: UTF-16
Locale: neutral
Case sensitivity: 14 14 14 14 14 14 14 14 14 14 14 14 11 14 14 14
*
Definition for table SCOTT.CUSTOMER
Record length: 996
Syskey: 0
Columns: 5
ID 64 50 0 0 0 1 0 50 50 50 0 0 0 0 1 0 1 2
FIRST_NAME 64 200 56 0 0 1 0 200 200 0 0 0 0 0 1 0 0 0
LAST_NAME 64 200 262 0 0 1 0 200 200 0 0 0 0 0 1 0 0 0
LOC 64 500 468 0 0 1 0 500 500 0 0 0 0 0 1 0 0 0
CRT_DT 192 19 974 0 0 1 0 19 19 19 0 5 0 0 1 0 0 0
End of definition
数据初始化复制进程:
源端:
GGSCI (chenyj-WorkPC) 1> view param iniext
sourceistable
userid ggs, password ggs
rmthost 127.0.0.1,mgrport 7700
rmtfile D:\ggora-ms\ggsms\dirdat\ex
table scott.customer;
调用 extract paramfile dirprm/iniext.prm reportfile dirpt/iniext.rpt
这样数据就传输到了SQLServer的GoldenGate
目标端:
GGSCI (chenyj-WorkPC) 1> view param inirep
specialrun
end runtime
targetdb ggs_nc
extfile D:\ggora-ms\ggsms\dirdat\ex
sourcedefs D:\ggora-ms\ggsms\dirdef\source.def
map scott.customer, target dbo.customer;
调用replicat paramfile dirprm/inirep.prm将源端的初始数据复制进SQLServer
接下来配置即时复制进程
源端:
add extract extora1, tranlog, begin now
ADD RMTTRAIL D:\ggora-ms\ggsms\dirdat\oa, EXTRACT EXTO
RA1
GGSCI (chenyj-WorkPC) 1> view param extora1
extract extora1
userid ggs, password ggs
rmthost 127.0.0.1, mgrport 7700
rmttrail D:\ggora-ms\ggsms\dirdat\oa
table scott.customer;
目标端:
dblogin sourcedb ggs_nc
GGSCI (chenyj-WorkPC) 4> add checkpointtable dbo.chkpt
Successfully created checkpoint table dbo.chkpt.
GGSCI (chenyj-WorkPC) 5> add replicat msrep1,exttrail D:\ggora-ms\ggsms\dirdat\o
a, checkpointtable dbo.chkpt
REPLICAT added.
GGSCI (chenyj-WorkPC) 7> view param msrep1
REPLICAT MSREP1
targetdb ggs_nc
SOURCEDEFS dirdef/source.def
MAP scott.customer, TARGET dbo.customer;
分别启动源端的extract组oraext1与目标端的replicat组msrep1
测试。
基本复制就完成了
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8520577/viewspace-766456/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/8520577/viewspace-766456/