温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

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

发布时间:2020-08-12 05:48:01 来源:ITPUB博客 阅读:186 作者:shilei1 栏目:关系型数据库
数据分布配置是一对多得配置方案。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里的对象。
向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI