说明:本文为Oracle GoldenGate进程模式转换指定手册
模式:抓取进程经典模式转集成模式(classic转integrated)
温馨提示:如果您发现本文哪里写的有问题或者有更好的写法请留言或私信我进行修改优化
组类型 |
模式名称 |
简要说明 |
extract |
classic(经典模式) |
在经典捕获模式下,Oracle GoldenGate Extract进程从源系统上的Oracle重做或归档日志文件或备用系统上附带的归档日志中捕获数据更改 |
integrated(集成模式) |
在集成捕获模式下,Oracle GoldenGate Extract流程与数据库日志挖掘服务器直接交互,以逻辑更改记录(LCR)的形式接收数据更改 |
|
replicate |
integrated(集成模式) |
在集成模式下,复制过程利用了Oracle数据库中可用的应用处理功能。 |
nonintegrated(非集成模式) 又叫classic(经典模式) |
在非集成模式下,复制过程是一个单线程进程,它使用标准SQL将数据应用于目标表 |
|
coordinated(协作模式) |
经典模式和协作模式之间的区别在于,复制在协作模式下是多线程的。在单个Replicat实例中,多个线程独立读取跟踪并并行应用事务。每个线程都为其分配的工作负载处理过滤,映射,转换,SQL构造和错误处理。一个协调线程协调跨线程的交易帐户的线程之间的依赖关系。 |
下图为:经典模式
下图为:集成模式
★ 知识点
/
※ 原来的trail文件可以继续使用,转换模式不涉及trail格式的更改
※ 该模式转换仅对当前进程有影响,对源端其他抓取进程、投递进程和目标端应用进程没有影响,不需要做改动
★ 集成模式环境要求
/
※ 摘要:数据库版本≥11.2.0.3,最好是≥11.2.0.4
※ 详情:
① 要支持所有Oracle数据和存储类型,源数据库的兼容性设置必须至少为11.2.0.3与Integrated Extract 11.2.x的11.2.0.3数据库特定的捆绑软件补丁(My Oracle Support文档ID 1557031.1)。要从My Oracle Support获得此补丁,请转到:https://support.oracle.com/oip/faces/secure/km/DocumentDisplay.jspx?id=1557031.1
② 要在不安装DDL支持对象的情况下支持DDL捕获,源数据库必须至少为Oracle 11.2.0.4或更高版本。对于早期的数据库版本,DDL支持对象是必需的,请参阅“ 安装基于触发器的DDL Capture”。
★ 大致步骤和命令
/
※ 向挖掘数据库注册提取组。除此之外,它还创建了日志挖掘服务器。
※ 查看OGG状态,直到状态为“is ready”后停止并进行模式切换
※ 执行脚本
※ 验证对比
OGG > start ex_scott
OGG > dblogin userid ogg,password ogg
OGG > register extract ex_scott database
OGG > INFO EXTRACT ex_scott UPGRADE
OGG > stop ex_scott
OGG > ALTER EXTRACT ex_scott UPGRADE INTEGRATED TRANLOG
SQL> @/ogg123/prvtlmpg.plb
OGG > start ex_scott
★ 常见问题
/
※ 参数不支持
提示:2020-04-17 12:25:32 ERROR OGG-10144 (ex_scott.prm) line 13: Parameter [logretention] is not valid for this configuration.
原因:集成模式不支持部分classic的参数:tranlogoptions logretention sr
※ 打补丁
提示:2020-04-17 14:48:23 ERROR OGG-02912 Patch 17030189 is required on your Oracle mining database for trail format RELEASE 12.2 or later.
原因:对于trail格式12.2或更高版本的Oracle挖掘数据库,需要使用补丁17030189
★ 操作详情
/
✔ 进入OGG并查看原始状态(经典模式)
[root@rac1 ~]# su - oggos
[oggos@rac1 ~]$ rlwrap /ogg123/ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 12.3.0.1.4 30547022_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Dec 27 2019 17:52:01
Operating system character set identified as UTF-8.
Copyright (C) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
GGSCI (rac1) > info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EX_SCOTT 00:00:00 00:00:00
EXTRACT RUNNING PU_SCOTT 00:00:00 00:00:06
GGSCI (rac1) > info *
EXTRACT EX_SCOTT Last Started 2020-04-17 12:50 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:01 ago)
Process ID 6267
Log Read Checkpoint Oracle Redo Logs 【非集成模式的redo不带“Integrated”前缀】
2020-04-17 14:19:16 Seqno 18, RBA 28646912
SCN 0.1158601 (1158601)
EXTRACT PU_SCOTT Last Started 2020-04-17 12:49 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:09 ago)
Process ID 6268
Log Read Checkpoint File /ogg123/dirdat/es000000005
2020-04-17 12:50:00.669294 RBA 1408
✔ 执行转换
GGSCI (rac1) > dblogin userid ogg,password ogg
Successfully logged into database.
GGSCI (rac1 as ogg@rac1) > register extract ex_scott database
2020-04-17 14:25:36 INFO OGG-02003 Extract EX_SCOTT successfully registered with database at SCN 1158820.
GGSCI (rac1 as ogg@rac1) > INFO EXTRACT ex_scott UPGRADE
Extract EX_SCOTT is ready to be upgraded to integrated capture.
GGSCI (rac1) > stop ex_scott
Sending STOP request to EXTRACT EX_SCOTT ...
Request processed.
GGSCI (rac1 as ogg@rac1) > ALTER EXTRACT ex_scott UPGRADE INTEGRATED TRANLOG
Extract EX_SCOTT successfully upgraded to integrated capture.
✔ 给数据库打补丁17030189(其实是OGG下的一个SQL脚本)
[root@rac1 ~]# su - oracle
[oracle@rac1 ~]$ rlwrap sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Fri Apr 17 14:51:17 2020
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> @/ogg123/prvtlmpg.plb
Oracle GoldenGate Workaround prvtlmpg
This script provides a temporary workaround for bug 17030189.
It is strongly recommended that you apply the official Oracle
Patch for bug 17030189 from My Oracle Support instead of using
this workaround.
This script must be executed in the mining database of Integrated
Capture. You will be prompted for the username of the mining user.
Use a double quoted identifier if the username is case sensitive
or contains special characters. In a CDB environment, this script
must be executed from the CDB$ROOT container and the mining user
must be a common user.
=========================== WARNING ==========================
You MUST stop all Integrated Captures that belong to this mining
user before proceeding!
================================================================
Enter Integrated Capture mining user: ogg
Installing workaround...
No errors.
No errors.
No errors.
Installation completed.
SQL>
✔ 启动并查验
GGSCI (rac1 as ogg@rac1) > start EX_SCOTT
Sending START request to MANAGER ...
EXTRACT EX_SCOTT starting
GGSCI (rac1 as ogg@rac1) > info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EX_SCOTT 00:00:00 00:04:41
EXTRACT RUNNING PU_SCOTT 00:00:00 00:00:07
GGSCI (rac1 as ogg@rac1) 40> info *
EXTRACT EX_SCOTT Initialized 2020-04-17 14:26 Status STOPPED
Checkpoint Lag 00:00:00 (updated 00:05:48 ago)
Log Read Checkpoint Oracle Integrated Redo Logs 【集成模式的redo带“Integrated”前缀】
2020-04-17 14:26:59
SCN 0.1177450 (1177450)
EXTRACT PU_SCOTT Last Started 2020-04-17 14:31 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:04 ago)
Process ID 8156
Log Read Checkpoint File /ogg123/dirdat/es000000006
First Record RBA 1408
※ 如果您觉得文章写的还不错, 别忘了在文末给作者点个赞哦 ~
over