微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

【goldengate】官方文档笔记四 Oracle GoldenGate实时数据分布

数据分布配置是一对多得配置方案。OGG支持将源库同步到多个目标系统。

【goldengate】官方文档笔记四 Oracle GoldenGate实时数据分布



数据分布配置需要注意事项:
如果数据传输过程中,投递进程(data pump)发现目标库网络连接出现故障,捕获到得数据会继续像其它目标发送。在源端使用一个初始抽取组(extractgroup)和一个投递组(data pump extract group)对应多个目标数据库

创建数据分布结构

【goldengate】官方文档笔记四 Oracle GoldenGate实时数据分布




源端系统

配置管理进程
1,在源端配置管理进程,参见笔 【goldengate】官方文档笔记一
http://blog.itpub.net/29047826/viewspace-1249506/

2,在管理进程参数文件中,使用PURGEOLDEXTRACTS参数来控制本地trail文件的清除工作。

配置初级提取进程
3,在源端,使用ADD EXTRACT命令来创建一个初级提取组。在这里我们取名为ext。

ADD EXTRACT <ext>, {TRANLOG | INTEGRATED TRANLOG}, BEGIN <time>, [, THREADS]

4,在源端,使用ADD  EXTTRAIL命令来创建一个本地trail
ADD EXTTRAIL <local_trail>, EXTRACT <ext>
     使用参数EXTRACT将提取组ext和trail相链接提取组将信息写入trail,投递组从trail中读取。
5,在源端,使用EDIT ParaMS命令为初级提取组创建一个参数文件
-- Identify the Extract group:EXTRACT <ext>
-- Specify database login information as needed for the database:
[SOURCEDB <dsn_1>][, USERID <user>][, PASSWORD <pw> [<encryption options>]]
-- Specify the local trail that this Extract writes to
-
- and encryption options:
ENCRYPTTRAIL <encryption options>EXTTRAIL <local_trail>
-- Specify tables to be captured:
TABLE <owner>.<table>;
  • EXTTRAIL用于指定本地trail
配置数据泵投递组
在源头端,使用ADD EXTRACT 命令为每一个目标系统创建数据泵。在这里我们取名为pump_1,pump2.
ADD EXTRACT <pump_1>, EXTTRAILSOURCE <local_trail>, BEGIN <time>
ADD EXTRACT <pump_2>, EXTTRAILSOURCE <local_trail>, BEGIN <time>
EXTRACT参数用于将远程trail连接到不同的投递组。被指定的投递组将信息写入相对应的trail文件
8,在源端,使用EDIT ParaMS命令为每一个数据泵提取组创建参数文件
Data pump_1

-- Identify the data pump group:
EXTRACT <pump_1>
-- Specify database login information if using nopAsstHRU:
[SOURCEDB <dsn_1>][, USERID <user>][, PASSWORD <pw> [<encryption options>]]
-- Specify decryption options if input trail is encrypted.DECRYPTTRAIL
<encryption options>
-- Specify the name or IP address of the first target system
-- and optional encryption of data over TCP/IP:
RMTHOST <target_1>, MGRPORT <portnumber>, ENCRYPT <encryption options>
-- Specify remote trail and encryption options on first target system:
ENCRYPTTRAIL <encryption options>
RMTTRAIL <remote_trail_1>
-- Allow mapping, filtering, conversion or pass data through as-is:
[PAsstHRU | nopAsstHRU]
-- Specify tables to be captured:
TABLE <owner>.<table>;

Data pump_2

-- Identify the data pump group:
EXTRACT <pump_2>-- Specify database login information if using nopAsstHRU:
[SOURCEDB <dsn_1>][, USERID <user>][, PASSWORD <pw> [<encryption options>]]
-- Specify decryption options if input trail is encrypted.DECRYPTTRAIL
<encryption options>
-- Specify the name or IP address of the second target system
-- and optional encryption of data over TCP/IP:
RMTHOST <target_2>, MGRPORT <portnumber>, ENCRYPT <encryption options>
-- Specify remote trail and encryption options on second target system:
ENCRYPTTRAIL <encryption options>RMTTRAIL <remote_trail_2>
-- Allow mapping, filtering, conversion or pass data through as-is:
[PAsstHRU | nopAsstHRU]
-- Specify tables to be captured:
TABLE <owner>.<table>;

目标系统

配置管理进程
9,在源端配置管理进程,参见笔 【goldengate】官方文档笔记一
http://blog.itpub.net/29047826/viewspace-1249506/

10,在管理进程参数文件中,使用PURGEOLDEXTRACTS参数来控制本地trail文件的清除工作。

配置复制组
11,在每个目标系统上分别创建复制检查点表(Replicat checkpoint table)
12,在每个目标系统上,使用ADD REPLICAT命令为每一个远程系统上的trail创建复制组(Replicat group)。在这里我们取名为rep_1,rep_2
Target_1
ADD REPLICAT <rep_1>, EXTTRAIL <remote_trail>, BEGIN <time>

Target_2
ADD REPLICAT <rep_2>, EXTTRAIL <remote_trail>, BEGIN <time>
  • EXTTRAIL参数用于将复制组连接到正确的trail。
13,在每个目标系统上,使用EDIT PARMAS命令分别创建一个提取组参数文件

Target_1

-- Identify the Replicat group:
REPLICAT <rep_1>
-- State whether or not source and target deFinitions are identical:
SOURCEDEFS <full_pathname> | ASSUMetaRGETDEFS
-- Specify database login information as needed for the database:
[TARGETDB <dsn_2>][, USERID <user>][, PASSWORD <pw> [<encryption options>]]
-- Specify decryption options if input trail is encrypted.DECRYPTTRAIL
<encryption options>
-- Specify error handling rules:
REPERROR (<error>, <response>)
-- Specify tables for delivery:
MAP <owner>.<table>, TARGET <owner>.<table>[, DEF <template name>];

Target_2

-- Identify the Replicat group:
REPLICAT <rep_2>
-- State whether or not source and target deFinitions are identical:
SOURCEDEFS <full_pathname> | ASSUMetaRGETDEFS
-- Specify database login information as needed for the database:
[TARGETDB <dsn_3>][, USERID <user>][, PASSWORD <pw> [<encryption options>]]
-- Specify decryption options if input trail is encrypted.DECRYPTTRAIL
<encryption options>
-- Specify error handling rules:REPERROR (<error>, <response>) 
-- Specify tables for delivery:
MAP <owner>.<table>, TARGET <owner>.<table>[, DEF <template name>];
  • 你可以为复制组使用多个MAP语句。这些MAP语句必须指定包含在连接到该组中相同trail里的对象。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐