调整两台虚拟机的以下配置:
调整主机名
调整ip地址
关闭防火墙,或打开对应端口
上传winrar,
SW_DVD9_SQL_Svr_Enterprise_Edtn_2008_R2_ChnSimp_MLF_X16-29532.ISO
解压安装SQL SERVER 2008
安装 vcredist_x86.exe,即Visual C++ 2005 SP1 Retistributable Package
主机名称 ip地址 数据库实例
win2k8a 192.168.1.45 MSSQLSERVER
win2k8b 192.168.1.46 MSSQLSERVER
关闭防火墙
NT AUTHORITY\SYSTEM 安装时指定
WIN2K8A\Administrator
sa 密码 Oracle123
创建goldengate软件安装目录 C:\gg
拷贝V32410-01.zip至此目录,解压到当前目录
Microsoft Windows [版本 6.1.7600]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
C:\Users\Administrator>cd ../../
C:\>cd gg
C:\gg>ggsci
Oracle GoldenGate Command Interpreter for SQL Server
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230
Windows x64 (optimized), Microsoft SQL Server on Apr 23 2012 06:56:36
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
查看状态:
GGSCI (win2k8b) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
创建相关目录:
GGSCI (win2k8b) 2> create subdirs
Creating subdirectories under current directory C:\gg
Parameter files C:\gg\dirprm: already exists
Report files C:\gg\dirrpt: created
Checkpoint files C:\gg\dirchk: created
Process status files C:\gg\dirpcs: created
SQL script files C:\gg\dirsql: created
Database definitions files C:\gg\dirdef: created
Extract data files C:\gg\dirdat: created
Temporary files C:\gg\dirtmp: created
Stdout files C:\gg\dirout: created
添加服务:
GGSCI (win2k8b) 3> edit params ./GLOBALS
GGSCI (win2k8b) 4> view params ./GLOBALS
MGRSERVNAME OGG MGR Service
GGSCI (win2k8b) 5> shell install addservice
Service 'OGG MGR Service' created.
Install program terminated normally.
拷贝 C:\gg 下的category.dll,ggsmsg.dll 至 C:\Windows\System32 目录下
配置MGR:
GGSCI (win2k8b) 6> edit params mgr
GGSCI (win2k8b) 7> view params mgr
PORT 7809
启动MGR:
GGSCI (win2k8b) 10> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
----------------------------------------以上步骤,两台机器操作
源库配置:
建库
SourceDB
注意日志模式 full
备份
C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Backup\SourceDB.bak
执行demo_mss_create.sql
选定新建库,创建测试表
创建数据源
start---run---odbcad32.exe
创建数据源SouceSQLDB
调整相关表属性:
GGSCI (win2k8a) 17> dblogin sourcedb soucesqldb
2014-05-07 22:28:28 INFO OGG-03036 Database character set identified as win
dows-936. Locale: zh_Hans_CN.
2014-05-07 22:28:28 INFO OGG-03037 Session character set identified as GBK.
Successfully logged into database.
GGSCI (win2k8a) 18> add trandata dbo.tcustmer
2014-05-07 22:29:13 WARNING OGG-01483 The key for table [SourceDB.dbo.tcustmer
] contains one or more variable length columns. These columns may not have thei
r pre-images written to the transaction log during updates. Please use KEYCOLS
to specify a key for Oracle GoldenGate to use on this table.
Logging of supplemental log data is enabled for table dbo.tcustmer
GGSCI (win2k8a) 19>
GGSCI (win2k8a) 19> add trandata dbo.tcustord
2014-05-07 22:29:44 WARNING OGG-01483 The key for table [SourceDB.dbo.tcustord
] contains one or more variable length columns. These columns may not have thei
r pre-images written to the transaction log during updates. Please use KEYCOLS
to specify a key for Oracle GoldenGate to use on this table.
Logging of supplemental log data is enabled for table dbo.tcustord
GGSCI (win2k8a) 20> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
配置抽取进程:
GGSCI (win2k8a) 21> EDIT PARAMS EXT2008D
GGSCI (win2k8a) 22> view params ext2008d
EXTRACT EXT2008D
SOURCEDB SouceSQLDB
TRANLOGOPTIONS MANAGESECONDARYTRUNCATIONPOINT
EXTTRAIL ./dirdat/ET
TABLE dbo.tcustmer;
TABLE dbo.tcustord;
GGSCI (win2k8a) 23> add extract ext2008d,tranlog,begin now
EXTRACT added.
GGSCI (win2k8a) 25> add exttrail ./dirdat/ET,EXTRACT EXT2008D
EXTTRAIL added.
GGSCI (win2k8a) 26> INFO ALL
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT STOPPED EXT2008D 00:00:00 00:01:48
启动抽取进程:
GGSCI (win2k8a) 27> START EXT2008D
Sending START request to MANAGER ...
EXTRACT EXT2008D starting
GGSCI (win2k8a) 28> INFO ALL
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EXT2008D 00:00:00 00:00:00
配置泵取进程:
GGSCI (win2k8a) 30> EDIT PARAMS PMP2008D
GGSCI (win2k8a) 31> view params pmp2008d
EXTRACT PMP2008D
PASSTHRU
RMTHOST 192.168.1.46 MGRPORT 7809
RMTTRAIL ./dirdat/rt
TABLE dbo.*;
GGSCI (win2k8a) 32> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EXT2008D 00:00:00 00:00:09
GGSCI (win2k8a) 33> ADD EXTRACT PMP2008D, EXTTRAILSOURCE ./dirdat/ET
EXTRACT added.
GGSCI (win2k8a) 34> ADD RMTTRAIL ./dirdat/rt, EXTRACT PMP2008D
RMTTRAIL added.
GGSCI (win2k8a) 35> INFO ALL
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EXT2008D 00:00:00 00:00:04
EXTRACT STOPPED PMP2008D 00:00:00 00:00:38
启动泵取进程:
GGSCI (win2k8a) 36> START PMP2008D
Sending START request to MANAGER ...
EXTRACT PMP2008D starting
查看各进程状态正常:
GGSCI (win2k8a) 37> INFO ALL
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EXT2008D 00:00:00 00:00:03
EXTRACT RUNNING PMP2008D 00:00:00 00:00:58
配置目标端:
建库 TargetDB
注意日志模式,可为simple
执行demo_mss_create.sql
选定新建库,创建测试表
创建数据源
start---run---odbcad32.exe
创建数据源TargetSQLDB
GGSCI (win2k8b) 14> view params mgr
PORT 7809
GGSCI (win2k8b) 15> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
GGSCI (win2k8b) 16> dblogin sourcedb targetsqldb
2014-05-07 23:01:10 INFO OGG-03036 Database character set identified as win
dows-936. Locale: zh_Hans_CN.
2014-05-07 23:01:10 INFO OGG-03037 Session character set identified as GBK.
Successfully logged into database.
GGSCI (win2k8b) 17> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
编辑复制进程:
GGSCI (win2k8b) 18> EDIT PARAMS REP2008D
GGSCI (win2k8b) 19> VIEW PARAMS REP2008D
REPLICAT REP2008D
DBOPTIONS USERREPLICATIONUSER
TARGETDB TargetSQLDB
ASSUMETARGETDEFS
MAP dbo.*, TARGET dbo.*;
目标端添加检查点表:
GGSCI (win2k8b) 20> DBLOGIN SOURCEDB targetsqldb
2014-05-07 23:05:50 INFO OGG-03036 Database character set identified as win
dows-936. Locale: zh_Hans_CN.
2014-05-07 23:05:50 INFO OGG-03037 Session character set identified as GBK.
Successfully logged into database.
GGSCI (win2k8b) 21> add checkpointtable dbo.OGGCHKPT
Successfully created checkpoint table dbo.OGGCHKPT.
GGSCI (win2k8b) 23> ADD REPLICAT REP2008D, EXTTRAIL ./dirdat/rt, CHECKPOINTTABLE
dbo.OGGCHKPT
REPLICAT added.
GGSCI (win2k8b) 24> INFO ALL
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT STOPPED REP2008D 00:00:00 00:00:06
启动复制进程:
GGSCI (win2k8b) 25> START REP2008D
Sending START request to MANAGER ...
REPLICAT REP2008D starting
查看管理进程及复制进程状态:
GGSCI (win2k8b) 26> INFO ALL
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT STOPPED REP2008D 00:00:00 00:00:17
GGSCI (win2k8b) 27> START REP2008D
Sending START request to MANAGER ...
REPLICAT REP2008D starting
复制进程rep2008d进程启动失败,报错日志如下:
INFO OGG-00995 Oracle GoldenGate Delivery for SQL Server, REP2008D.prm: REPLICAT REP2008D starting.
2014-05-07 23:09:05 INFO OGG-03035 Oracle GoldenGate Delivery for SQL Server, REP2008D.prm: Operating system character set identified as GBK. Locale: zh_Hans_CN, LC_ALL:.
2014-05-07 23:09:05 ERROR OGG-00303 Oracle GoldenGate Delivery for SQL Server, REP2008D.prm: Did not recognize DBOPTIONS parameter argument USERREPLICATIONUSER.
2014-05-07 23:09:05 ERROR OGG-01668 Oracle GoldenGate Delivery for SQL Server, REP2008D.prm: PROCESS ABENDING.
GGSCI (win2k8b) 4> edit params rep2008d
GGSCI (win2k8b) 8> view params rep2008d
REPLICAT REP2008D
--DBOPTIONS USERREPLICATIONUSER
TARGETDB TargetSQLDB
ASSUMETARGETDEFS
MAP dbo.*, TARGET dbo.*;
根据报错提示,注释掉 DBOPTIONS USERREPLICATIONUSER,重新启动rep2008d,启动成功。
GGSCI (win2k8b) 6> start rep2008d
Sending START request to MANAGER ('OGG MGR Service') ...
REPLICAT REP2008D starting
GGSCI (win2k8b) 7> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING REP2008D 00:00:00 00:00:04
测试:源端sourcedb运行 demo_mss_insert.sql,目标端targetdb 查看相应表的行数,同步成功。
|
|