- 最后登录
- 2014-5-7
- 在线时间
- 4 小时
- 威望
- -11
- 金钱
- 31
- 注册时间
- 2012-12-3
- 阅读权限
- 0
- 帖子
- 14
- 精华
- 0
- 积分
- -11
- UID
- 718
|
5#
发表于 2013-1-15 09:47:52
完整流程!
一、准备实施环境
配置linux服务器,并安装oracle database。
二、实施goldengate安装
1.下载goldengate,并配置安装
2.
三、初始化数据库
1.source database
$ ./ggsci
GGSCI (source) 2> create SUBDIRS
GGSCI (source) 3> dblogin userid ogg,password ogg;
GGSCI (source) 4> add trandata ogg.*
GGSCI (source) 5> info trandata ogg.*
GGSCI (source) 6> edit params mgr (添加下列参数)
port 7809
purgeoldextracts /dirdat,usecheckpoints
GGSCI (source) 7> start mgr
GGSCI (source) 8> info mgr
GGSCI (source) 9> ADD EXTRACT EINI_1, SOURCEISTABLE
GGSCI (source) 10> INFO EXTRACT *, TASKS
GGSCI (source) 11> EDIT PARAMS EINI_1(添加下列参数)
EXTRACT EINI_1
SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
USERID ogg, PASSWORD ogg
RMTHOST 10.0.0.12, MGRPORT 7809
RMTTASK REPLICAT, GROUP RINI_1
TABLE ogg.*;
GGSCI (source) 12> START EXTRACT EINI_1
GGSCI (source) 13> view report EINI_1
2.mirror database
$ ./ggsci
GGSCI (mirrordb) 2> create subdirs
GGSCI (mirrordb) 3> dblogin userid ogg,password ogg;
GGSCI (mirrordb) 4> edit params mgr
PORT 7809
PURGEOLDEXTRACTS /dirdat, USECHECKPOINTS
GGSCI (mirrordb) 5> start mgr
GGSCI (mirrordb) 6> info mgr
GGSCI (mirrordb) 7> ADD REPLICAT RINI_1, SPECIALRUN
GGSCI (mirrordb) 8> INFO REPLICAT *, TASKS
GGSCI (mirrordb) 9> EDIT PARAMS RINI_1
REPLICAT RINI_1
SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
ASSUMETARGETDEFS
USERID ogg, PASSWORD ogg
DISCARDFILE ./dirrpt/RINIaa.dsc, PURGE
MAP ogg.*, TARGET ogg.*;
GGSCI (mirrordb) 10> START REPILCAT RINI_1
GGSCI (mirrordb) 11> view report RINI_1
四、配置日志抓取进程和传输进程(source database)
1.创建配置抓取进程
add extract source,tranlog, begin now
add exttrail ./dirdat/so,extract source,megabytes 200
edit params source
extract source
userid ogg, password ogg
tranlogoptions altarchivelogdest /u01/app/oracle/oradata/orcl/archive_log1
tranlogoptions altarchivedlogformat %t_%s_%r.dbf
gettruncates
reportcount every 30 minutes, rate
discardfile ./dirrpt/source.dsc,purge
exttrail ./dirdat/so
table ogg.*;
start extract source
info all
view report source
2.创建日志传输进程
add extract pump exttrailsource ./dirdat/so
add rmttrail ./dirdat/so,extract pump
edit params pump
extract pump
passthru
rmthost 10.0.0.12,mgrport 7809,compress
numfiles 5000
dynamicresolution
rmttrail ./dirdat/so
table ogg.*;
START EXTRACT pump
INFO ALL
VIEW REPORT pump
五、配置镜像数据库复制进程(mirror database)
$./ggsci
ggsci>dblogin userid ggmgr, password oracle
ggsci>edit params mgr
port 7809
purgeoldextracts /dirdat,usecheckpoints
ggsci>start mgr
ggsci>info all
ggsci>dblogin userid ogg, password ogg
ggsci>EDIT PARAMS ./GLOBALS
checkpointtable ogg.ggs_checkpointtable
ggsci>ADD checkpointtable ogg.ggs_checkpointtable
ggsci>ADD REPLICAT mirror,EXTTRAIL ./dirdat/so,checkpointtable ogg.ggs_checkpointtable
ggsci>EDIT PARAMS mirror
replicat mirror
userid ogg, password ogg
assumetargetdefs
discardfile ./dirrpt/mirror.dsc,purge
map ogg.*,target ogg.*;
ggsci>start replicat mirror
ggsci>view report mirror
六. 启动Goldengate
1.源数据库启动进程
$./ggsci
ggsci>INFO ALL
STOPED
ggsci>start mgr
ggsci>START EXTRACT source
ggsci>start extract pump
ggsci>INFO ALL
RUNNING
2.镜像系统启动复制进程
ggsci>start mgr
ggsci>start extract mirror
ggsci>info all
确认mgr与reptyfc进程都处于RUNNING状态。
ggsci>view report reptyfc
查看复制进程reptyfc的相关日志
七、验证数据同步 |
|