Golengate的基本工作原理是通过挖掘重做日志以获取数据库中的数据变化;而如果我们在数据库中使用并行DML去插入数据的话会因为直接路径插入而产生少量的redo重做日志。那么OGG的日志挖掘是否能正确捕获这些并行DML所产生的数据变化呢?接着我们来实际地测试一下:

SQL> select le.leseq "Current log sequence No",2         100 * cp.cpodr_bno / le.lesiz "Percent Full",3         (cpodr_bno - 1) * 512 "Current Offset",4         le.lesiz * 512 - cpodr_bno * 512 "Left space"5    from x$kcccp cp, x$kccle le6   where LE.leseq = CP.cpodr_seq7     and bitand(le.leflg, 24) = 8;Current log sequence No Percent Full Current Offset Left space
----------------------- ------------ -------------- ----------177   78.5112305       82324480   22532608/* 通过以上查询我们可以了解实际的redo写出情况:Current Offset说明了当前日志文件所写到的位置,而Left Space说明了当前日志文件所剩余的空间
82324480(Current Offset)+22532608(Left space)+512(redo header)=logfile size=le.lesiz* redo block size
*/SQL> alter system switch logfile;
System altered.SQL> select le.leseq "Current log sequence No",2         100 * cp.cpodr_bno / le.lesiz "Percent Full",3         (cpodr_bno - 1) * 512 "Current Offset",4         le.lesiz * 512 - cpodr_bno * 512 "Left space"5    from x$kcccp cp, x$kccle le6   where LE.leseq = CP.cpodr_seq7     and bitand(le.leflg, 24) = 8;Current log sequence No Percent Full Current Offset Left space
----------------------- ------------ -------------- ----------179   .002441406           2048  104855040/* 初始位置为No 179的日志文件 */SQL> select le.leseq "Current log sequence No",2         100 * cp.cpodr_bno / le.lesiz "Percent Full",3         (cpodr_bno - 1) * 512 "Current Offset",4         le.lesiz * 512 - cpodr_bno * 512 "Left space"5    from x$kcccp cp, x$kccle le6   where LE.leseq = CP.cpodr_seq7     and bitand(le.leflg, 24) = 8;Current log sequence No Percent Full Current Offset Left space
----------------------- ------------ -------------- ----------180    58.277832       61108224   43748864/* 使用普通非并行DML插入产生了104855040+61108224=158M的redo */SQL> truncate table tv;
Table truncated.SQL> select le.leseq "Current log sequence No",2         100 * cp.cpodr_bno / le.lesiz "Percent Full",3         (cpodr_bno - 1) * 512 "Current Offset",4         le.lesiz * 512 - cpodr_bno * 512 "Left space"5    from x$kcccp cp, x$kccle le6   where LE.leseq = CP.cpodr_seq7     and bitand(le.leflg, 24) = 8;Current log sequence No Percent Full Current Offset Left space
----------------------- ------------ -------------- ----------180   60.6469727       63592448   41264640/* 初始为No 180日志文件的63592448 */SQL> alter session enable parallel dml;
Session altered./* 在session级别启用并行DML */SQL> set autotrace on;
SQL> insert /*+ parallel(tv,4) */ into tv select * from sample;3640772 rows created.
Execution Plan
----------------------------------------------------------
ERROR:
ORA-12838: cannot read/modify an object after modifying it in parallel
SP2-0612: Error generating AUTOTRACE EXPLAIN report
Statistics
----------------------------------------------------------111  recursive calls1168  db block gets17850  consistent gets17745  physical reads97944  redo size815  bytes sent via SQL*Net to client750  bytes received via SQL*Net from client3  SQL*Net roundtrips to/from client1  sorts (memory)0  sorts (disk)3640772  rows processed/* autotrace statistics显示并行插入仅产生了97944字节的redo */SQL> commit;
Commit complete.SQL> select le.leseq "Current log sequence No",2         100 * cp.cpodr_bno / le.lesiz "Percent Full",3         (cpodr_bno - 1) * 512 "Current Offset",4         le.lesiz * 512 - cpodr_bno * 512 "Left space"5    from x$kcccp cp, x$kccle le6   where LE.leseq = CP.cpodr_seq7     and bitand(le.leflg, 24) = 8;Current log sequence No Percent Full Current Offset Left space
----------------------- ------------ -------------- ----------182   10.4882813       10997248   93859840/* 而实际上日志由180切换到了182,实际的redo产生大约是41264640+104857600+10997248=150M *//* 换而言之autotrace对并行DML语句所产生的实际redo统计远少于实际值,这也就保证了extract能够捕获到所有这些并行DML所引起的数据变化
*/GGSCI (rh2.oracle.com) 59> stats load2
Sending STATS request to EXTRACT LOAD2 ...Start of Statistics at 2010-12-16 20:17:35.Output to /s01/new/ze:Extracting from CLINIC.TV to CLINIC.TV:*** Total statistics since 2010-12-16 20:17:24 ***Total inserts                           923555.00Total updates                                0.00Total deletes                                0.00Total discards                               0.00Total operations                        923555.00*** Daily statistics since 2010-12-16 20:17:24 ***Total inserts                           923555.00Total updates                                0.00Total deletes                                0.00Total discards                               0.00Total operations                        923555.00*** Hourly statistics since 2010-12-16 20:17:24 ***Total inserts                           923555.00Total updates                                0.00Total deletes                                0.00Total discards                               0.00Total operations                        923555.00*** Latest statistics since 2010-12-16 20:17:24 ***Total inserts                           923555.00Total updates                                0.00Total deletes                                0.00Total discards                               0.00Total operations                        923555.00End of Statistics.GGSCI (rh2.oracle.com) 60> !
stats load2Sending STATS request to EXTRACT LOAD2 ...Start of Statistics at 2010-12-16 20:17:37.Output to /s01/new/ze:Extracting from CLINIC.TV to CLINIC.TV:*** Total statistics since 2010-12-16 20:17:24 ***Total inserts                           1090336.00Total updates                                0.00Total deletes                                0.00Total discards                               0.00Total operations                        1090336.00*** Daily statistics since 2010-12-16 20:17:24 ***Total inserts                           1090336.00Total updates                                0.00Total deletes                                0.00Total discards                               0.00Total operations                        1090336.00*** Hourly statistics since 2010-12-16 20:17:24 ***Total inserts                           1090336.00Total updates                                0.00Total deletes                                0.00Total discards                               0.00Total operations                        1090336.00*** Latest statistics since 2010-12-16 20:17:24 ***Total inserts                           1090336.00Total updates                                0.00Total deletes                                0.00Total discards                               0.00Total operations                        1090336.00End of Statistics.GGSCI (rh2.oracle.com) 61> !
stats load2Sending STATS request to EXTRACT LOAD2 ...Start of Statistics at 2010-12-16 20:17:39.Output to /s01/new/ze:Extracting from CLINIC.TV to CLINIC.TV:*** Total statistics since 2010-12-16 20:17:24 ***Total inserts                           1249284.00Total updates                                0.00Total deletes                                0.00Total discards                               0.00Total operations                        1249284.00*** Daily statistics since 2010-12-16 20:17:24 ***Total inserts                           1249284.00Total updates                                0.00Total deletes                                0.00Total discards                               0.00Total operations                        1249284.00*** Hourly statistics since 2010-12-16 20:17:24 ***Total inserts                           1249284.00Total updates                                0.00Total deletes                                0.00Total discards                               0.00Total operations                        1249284.00*** Latest statistics since 2010-12-16 20:17:24 ***Total inserts                           1249284.00Total updates                                0.00Total deletes                                0.00Total discards                               0.00Total operations                        1249284.00End of Statistics./* 可以看到extract的统计信息中Total inserts不断递增,说明extract正确捕获了所有由并行INSERT引发的直接路径插入操作
*/

Does Oracle Goldengate support Parallel DML? 结论显然是: Yes。

转载于:https://www.cnblogs.com/macleanoracle/archive/2010/12/16/2967611.html

Does Oracle Goldengate support Parallel DML?相关推荐

  1. 76 道 Oracle Goldengate 面试问题

    基础 12c新特性 性能 Troubleshoot 其它 1. Oracle Goldengate 支持部署到哪些拓扑? GoldenGate supports the following topol ...

  2. 【ogg Reference Part II Oracle GoldenGate Microservices Architecture】5 Oracle GoldenGate AdminClient

    您可以使用Oracle GoldenGate MA使用HTML用户界面配置和管理数据复制. 本部分描述可以与Oracle GoldenGate微服务体系结构一起使用的命令.参数和选项. 5 Oracl ...

  3. 使用 Oracle GoldenGate 进行实时数据集成

    [转自]http://blog.chinaunix.net/u1/53677/showart_2314585.html 使用 Oracle GoldenGate 进行实时数据集成 了解如何安装.设置和 ...

  4. Oracle GoldenGate 之--异构平台同步(Mysql到Oracle)

    Oracle GoldenGate 异构平台同步(Mysql到Oracle) 如图所示:源端采用Mysql库,目标端采用Oracle库 一.OGG安装配置(源端) 1.OGG下载 https://ed ...

  5. extract进程 oracle,Oracle GoldenGate 系列:Extract 进程遇长事务执行 Forcestop 引发的惨案...

    2.XX2库分析 停止XX2库 Extract进程时正在处理的长事务为 select t.addr,t.XIDUSN,t.XIDSLOT,t.XIDSQN,t.START_DATE from  gv$ ...

  6. Oracle Goldengate ERROR OGG 00446 解决方法

    一.问题描述: 2013年4月14日中午12点左右生产环境执行数据库版本升级期间根据需要停止XX1库和XX2库OGG 同步抽取进程时遇长事务,无法用正常命令停止,执行 forcestop 后重启进程报 ...

  7. OGG|Oracle GoldenGate 基础

    作者 | JiekeXu 来源 |公众号 JiekeXu DBA之路(ID: JiekeXu_IT) 大家好,我是 JiekeXu,很高兴又和大家见面了,今天和大家一起来学习利用 OGG 19c 迁移 ...

  8. 数据复制软件---Oracle GoldenGate

    前言 GoldenGate软件是一种基于日志的结构化数据复制软件,它通过解析源数据库在线日志或归档日志获得数据的增量变化,再将这些变化应用到目标数据库,从而实现源数据库与目标数据库同步.GoldenG ...

  9. 浅谈Oracle GoldenGate

    文章目录 1.简介 2.用途 3.常用拓扑 4.架构 4.1.工作流程 4.2.Manager管理模块 4.3.Extract(Capture)抽取模块 4.3.1.抽取和故障恢复原理 4.4.Ext ...

最新文章

  1. 聊一聊我在 B站 上自学编程的经历吧
  2. Android studio 使用心得(六)---android studio 如何加载.so文件
  3. mysql字符串和数字的互相转换
  4. Oracle数据库中IN参数个数超过1000的问题
  5. oracle中kill session的方法
  6. 2014/08/31 Zushi
  7. js基础知识(pomelo阅读)
  8. 微信小程序MQTT客户端的坑
  9. 这样选择报表系统,才能更好的进行企业管理
  10. Android studio进行文件对比
  11. fedora安装字体
  12. Ventoy+WePE 装机教程(装PVE+ESXI等,不用单独费一个U盘)
  13. 海王夺回王位科学深意:杂种是怎么一步步主宰地球的
  14. 如何实现通过本地远程来连接OpenStack中的windows虚机
  15. cephadm全功能安装Ceph Pacfic
  16. 关于 range.autofilter 和 VBA的 filter
  17. python re模块下载_python: re模块
  18. HTML期末大作业~web前端开发个人博客HTML整站模板~Web大学生网页成品 ~个人主页博客网页HTML设计制作...
  19. Socket 套接字原理详解
  20. IDEA2020下载安装

热门文章

  1. 扩展log4j系列[二]为DailyRollingFileAppender加上maxBackupIndex属性
  2. Python之队列和数据库
  3. mysql 支持gbk_MySQL不支持GBK编码的解决方法
  4. 基于FPGA实现DAC8811接口(正弦波)
  5. SDL 播放pcm数据
  6. boost::asio
  7. 3dmax脚本_3DMax二种距离测量方法
  8. s3c6410 uboot代码分析《二》
  9. NAND FLASH读写原理
  10. mpeg4视频中,I帧、p帧、B帧的判定