【大数据实时数据同步】超级详细的生产环境OGG(GoldenGate)12

本文详细描述了如何使用OracleGoldenGateOGG进行SCOTT用户下emp和dept表的从源端到目的端的同步过程,包括MGR配置、抽取和投递进程设置、DDL处理以及数据传输和审计表初始化等步骤。
摘要由CSDN通过智能技术生成

MARKER SEQUENCE

OK


## 九、配置主库到备库同步(支持DDL)


需求:将源端scott用户下的emp,dept 表通过ogg同步到目的端 ,逻辑同生产ODS


### 1、源端配置


MGR进程配置(源端和目的端都做下面操作,添加的参数也一样):



GGSCI (source) 6> info all

Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING
GGSCI (source) 7> edit params mgr
–加入下面内容
PORT 7809
DYNAMICPORTLIST 7810-7860
AUTORESTART ER *, RETRIES 3, WAITMINUTES 5
PURGEOLDEXTRACTS ./dirdat/*, USECHECKPOINTS, MINKEEPDAYS 30
lagreporthours 1
laginfominutes 30
lagcriticalminutes 60
–保存退出后,重启管理进程,让配置生效:
GGSCI (source) 8> stop mgr
Manager process is required by other GGS processes.
Are you sure you want to stop it (y/n)?y

Sending STOP request to MANAGER …
Request processed.
Manager stopped.

GGSCI (source) 9> start mgr
Manager started.
GGSCI (source) 10> info all

Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING


### 2、源端新增抽取进程配置



GGSCI (source) 12> edit params e_sc
–加入如下内容:
extract e_sc
userid ogg,password ogg
setenv(NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
setenv(ORACLE_SID=“orcl”)
reportcount every 30 minutes,rate
numfiles 5000
discardfile ./dirrpt/e_sc.dsc,append,megabytes 1000
warnlongtrans 2h,checkinterval 30m
exttrail ./dirdat/sc
dboptions allowunusedcolumn
tranlogoptions archivedlogonly
tranlogoptions altarchivelogdest primary /u01/arch
ddl include mapped
ddloptions addtrandata,report
notcpsourcetimer
nocompressupdates
fetchoptions USEROWID
NOCOMPRESSDELETES
----------scott.EMP
table SCOTT.EMP,tokens(
TKN-CSN = @GETENV(‘TRANSACTION’, ‘CSN’),
TKN-COMMIT-TS = @GETENV (‘GGHEADER’, ‘COMMITTIMESTAMP’),
TKN-OP-TYPE = @GETENV (‘GGHEADER’, ‘OPTYPE’)
);
----------SCOTT.DEPT
table SCOTT.DEPT,tokens(
TKN-CSN = @GETENV(‘TRANSACTION’, ‘CSN’),
TKN-COMMIT-TS = @GETENV (‘GGHEADER’, ‘COMMITTIMESTAMP’),
TKN-OP-TYPE = @GETENV (‘GGHEADER’, ‘OPTYPE’)
);


### 3、源端配置投递进程配置



GGSCI (source) 13>edit params d_sc
–加入如下内容:
extract d_sc
rmthost 192.168.1.10,mgrport 7809,compress
userid ogg,password ogg
PASSTHRU
numfiles 5000
rmttrail ./dirdat/sc
dynamicresolution
table scott.*;


### 4、源端增加抽取进程



GGSCI (source) 16> add extract e_sc,tranlog,begin now
EXTRACT added.

GGSCI (source) 17> add exttrail ./dirdat/sc,extract e_sc,megabytes 500
EXTTRAIL added.


### 5、源端增加投递进程



add extract d_sc,exttrailsource ./dirdat/sc
add rmttra

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值