赞
踩
OGG远程部署方式,最佳抽取方式。
OGG版本:19.1
操作系统版本:linux 7
- startup mount
- alter database archivelog;
note:作为目标端,不capture数据不需要配置
- alter database force logging;
-
note:作为目标端,不capture数据不需要配置
- alter database add supplemental log data;
-
note:作为目标端,不capture数据不需要配置
- alter system set enable_goldengate_replication=true;
-
note:11.2.0.4以上需要配置
表空间
- create tablespace ggtbs datafile '+DATA' size 1g autoextend on;
-
用户
- create user ggadmin identified by ggadmin default tablespace ggtbs quota unlimited on ggtbs;
-
授权
- grant connect,resource to ggadmin;
- grant alter session to ggadmin;
- grant select any dictionary to ggadmin;
- grant select any transaction to ggadmin;
- grant select any table to ggadmin;
- grant flashback any table to ggadmin;
- grant alter any table to ggadmin;
- exec dbms_goldengate_auth.grant_admin_privilege('GGADMIN','*',TRUE)
-
note:除了必要权限,其他权限可以根据实际情况而定。
组
- groupadd oinstall
-
用户
- useradd -g oinstall oracle
- passwd oracle
-
目录
- mkdir /ogg/oraclient -p
- mkdir /ogg/ogg191
- mkdir /ogg/oraInventory
- chown oracle:oinstall -R /ogg
- chmod 775 -R /ogg
-
- export ORACLE_HOME=/ogg/oraclient/instantclient_11_2
- export GG_HOME=/ogg/ogg191
- export LD_LIBRARY_PATH=$ORACLE_HOME:$GG_HOME
- export PATH=$ORACLE_HOME:$GG_HOME:$PATH
- alias ggsci='cd GG_HOME; ggsci'
-
note:最基础客户端包即可
- unzip -d /ogg/oraclient instantclient-basic-linux.x64-11.2.0.4.0
-
解压
- unzip 19.1.0.0.4-for-Oracle-on-Linux x86-64
-
编辑响应文件
- vi /home/oracle/fbo_ggs_Linux_x64_shiphome/Disk1/response/oggcore.rsp
-
- INSTALL_OPTION=ORA11g
- SOFTWARE_LOCATION=/ogg/ogg191
- START_MANAGER=
- MANAGER_PORT=
- DATABASE_LOCATION=
- INVENTORY_LOCATION=/ogg/oraInventory
- UNIX_GROUP_NAME=oinstall
-
静默安装
- ./runInstaller -silent -showProgress -responseFile /home/oracle/fbo_ggs_Linux_x64_shiphome/Disk1/response/oggcore.rsp
-
note:以下配置均为远程捕获和交付的方式,无需在数据库本地安装部署。
创建目录
- mkdir -p /ogg/oraclient/instantclient_11_2/network/admin
-
配置tnsnames.ora
- vi tnsnames.ora
-
- 源端库
- WLDB=
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP)(HOST = XXXXXX)(PORT = 1521))
- (CONNECT_DATA =
- (SERVER = DEDICATED)
- (SERVICE_NAME = WLDB)
- )
- )
-
- 目标库
- TARGET=
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP)(HOST = XXXXXX)(PORT = 1521))
- (CONNECT_DATA =
- (SERVER = DEDICATED)
- (SERVICE_NAME = WLDB)
- )
- )
-
登录ogg交互工具
- ggsci
-
创建目录
- create subdirs
-
编辑参数
- edit param mgr
-
- PORT 7809
- DYNAMICPORTLIST 7810-7899
- AUTORESTART ER *,RETRIES 5,WAITMINUTES 3
- PURGEOLDEXTRACTS ./dirdat/*,usecheckpoints, minkeepdays 7
- LAGREPORTHOURS 1
- LAGINFOMINUTES 30
- LAGCRITICALMINUTES 45
-
启动
- start mgr
-
查看
- info all
-
配置
- add credentialstore
- alter credentialstore add user ggadmin@wldb, password Oggadmin_#123 alias wldb
- alter credentialstore add user ggadmin@target, password Oggadmin_#123 alias target
-
验证
- dblogin useridalias wldb
-
添加附加日志
- dblogin useridalias wldb
- add trandata test.*
-
添加进程
- add extract wl_e, tranlog, begin now,threads 2 --节点数
- add exttrail ./dirdat/wl, extract wl_e, MEGABYTES 1024
-
配置参数
- edit param wl_e
-
- EXTRACT wl_e
- SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
- USERIDALIAS wldb
- TRANLOGOPTIONS dblogreader
- LOGALLSUPCOLS
- GETTRUNCATES
- EXTTRAIL ./dirdat/wl
- DISCARDFILE ./dirrpt/wl_e.dsc, APPEND, MEGABYTES 1024
- WARNLONGTRANS 1H, CHECKINTERVAL 5M
- CACHEMGR CACHESIZE 1024MB, CACHEDIRECTORY ./dirtmp
- REPORTCOUNT EVERY 60 SECONDS, RATE
-
- TABLE test.*;
-
Note:dblogreader最低支持版本为11.2.0.4,通过数据字典的方式获取日志信息,需要select any transaction权限
启动
- start wl_e
-
查看
- info all
-
note:推荐集成模式,性能更好,原理是整合logminer,多租户环境只能用集成模式
数据库stream参数调整,一个进程建议1.25g
- alter system set streams_pool_size=10g;
-
添加附加日志
- dblogin useridalias wldb
- add trandata test.*
-
添加进程
- ADD EXTRACT ie_e INTEGRATED TRANLOG BEGIN NOW
- ADD EXTTRAIL ./dirdat/ie EXTRACT ie_e MEGABYTES 1024
-
注册进程
- dblogin useridalias wldb
- REGISTER EXTRACT ie_e DATABASE
-
编辑参数
- edit param ie_e
-
- EXTRACT ie_e
- USERIDALIAS wldb
- LOGALLSUPCOLS
- NOCOMPRESSUPDATES
- UPDATERECORDFORMAT FULL
- DBOPTIONS ALLOWUNUSEDCOLUMN
- FETCHOPTIONS NOUSESNAPSHOT
- GETTRUNCATES
- EXTTRAIL ./dirdat/ie
- DISCARDFILE ./dirrpt/ie_e.dsc, PURGE, MEGABYTES 1024
- WARNLONGTRANS 1H, CHECKINTERVAL 5M
- CACHEMGR CACHESIZE 1024MB, CACHEDIRECTORY ./dirtmp
- REPORTCOUNT EVERY 60 SECONDS, RATE
-
- TABLE test.*;
-
-
Note:因为通过logminer挖掘日志,日志参数无需指定,可以利用参数配置logminer的并发数和内存大小
启动
- start ie_e
-
查看
- info all
-
添加进程
- add extract wl_p EXTTRAILSOURCE ./dirdat/wl
- add rmttrail /ogg/ogg191/dirdat/wl extract wl_p MEGABYTES 1024
-
编辑参数
- edit param wl_p
-
- EXTRACT wl_p
- DISCARDFILE ./dirrpt/wl_p.dsc, APPEND, MEGABYTES 1024
- RMTHOST 192.168.3.132, MGRPORT 7809
- RMTTRAIL /ogg/ogg191/dirdat/wl
- PASSTHRU
-
- TABLE test.*;
-
启动进程
- start wl_p
-
查看
- info all
-
添加数据库检查点表
- dblogin useridalias target
- add checkpointtable ggadmin.checkpoint
-
添加进程
- ADD REPLICAT wl_r EXTTRAIL /ogg/ogg191/dirdat/wl checkpointtable ggadmin.checkpoint
-
-
编辑参数
- edit param wl_r
-
- REPLICAT wl_r
- USERIDALIAS target
- REPERROR (DEFAULT, ABEND)
- DISCARDFILE ./dirrpt/wl_r.dsc, PURGE, MEGABYTES 1024
- GETTRUNCATES
- ALLOWNOOPUPDATES
- REPORTCOUNT EVERY 60 SECONDS, RATE
-
- MAP test.*, TARGET test.*;
-
登录后复制
启动
- start wl_r
-
查看
info all
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。