zoukankan      html  css  js  c++  java
  • skip a transaction in goldengate

    skip a transaction in goldengate


    [oracle@db ]$ ggsci

    Oracle GoldenGate Command Interpreter for Oracle
    Version 12.1.2.1.0 OGGCORE_12.1.2.1.0_PLATFORMS_140727.2135.1_FBO
    Linux, x64, 64bit (optimized), Oracle 12c on Aug 7 2014 10:21:34
    Operating system character set identified as UTF-8.

    Copyright (C) 1995, 2014, Oracle and/or its affiliates. All rights reserved.

    GGSCI (db) 1> info all

    Program Status Group Lag at Chkpt Time Since Chkpt

    MANAGER RUNNING
    EXTRACT RUNNING DP 00:00:00 00:00:07
    EXTRACT RUNNING EXT 00:00:00 00:00:08
    REPLICAT ABENDED REP 00:00:00 00:00:09

    GGSCI (db) 1> info rep rep

    REPLICAT REP Last Started 2018-07-30 11:40 Status RUNNING
    Checkpoint Lag 00:00:00 (updated 00:00:01 ago)
    Process ID 17208
    Log Read Checkpoint File ./dirdat/ab000174
    2018-07-30 18:24:38.905361 RBA 181415
    首先先找到replicat进程当前应用到的rba,也就是csn(commit sequence number),
    定位下次应用的起始RBA,它就是在trail文件中下一次replicat进程将要fseek() call 并起动进程的位置(actual byte position )

    Logdump 297 >open dirdat/ab000174
    Current LogTrail is /data/app/oracle/gg11/dirdat/ab000174
    Logdump 298 >pos 181415
    Reading forward from RBA 181415 Logdump 297 >open dirdat/ab000174
    Current LogTrail is /data/app/oracle/gg11/dirdat/ab000174
    Logdump 298 >pos 181415
    Reading forward from RBA 181415
    Logdump 299 >n

    2018-07-30 18:54:38.805311 GGSPKUpdate Len 69 RBA 261415
    Name: ICME.ICME_STUDENT
    After Image: Partition 4 G b
    0011 0000 000d 0000 0009 3131 3134 3032 3041 5900 | ..........1114020AY.
    0000 0500 0000 0133 0018 000c 0000 0008 bfa8 bac5 | .......3............
    d6d8 b8b4 001d 0015 0000 3230 3132 2d31 302d 3331 | ..........2018-07-30
    3a31 373a 3034 3a33 39 | :18:54:38
    Logdump 300 >n

    2018-07-30 18:56:48.805311 FieldComp Len 23 RBA 661415
    Name: ICME.ICME_PROJECT_SCORE
    After Image: Partition 4 G m
    0000 000a 0000 0000 0000 0252 1521 0001 0005 0000 | ...........R.!......
    0001 33 | ..3

    Logdump 301 >exit

    第一个n定位显示出当前应用的记录,要跳过这个事务要再输一个n,可以看到下一个记录的rba是661415。修改replicat进程启动时的rba指定为661415
    GGSCI (db) 1> alter replicat REP, extrba 661415
    REPLICAT altered.
    GGSCI (db) 2> start REP

    Sending START request to MANAGER ...
    REPLICAT rep starting
    如果还有失败的事务还可以继续next用上面的方法,不过如果有几个连续的事务需要skip,那就可以用另外一个方法.不过跳过的事务数是未知的,会记录到discard文件中
    start rep REP skiptransaction


  • 相关阅读:
    iPhone开发指南应用程序核心
    id,SEL,Nil,nil,IMP,Method,Class类型
    需求驱动赢得创新
    Linux内核list&hlist解读
    转载:x86的cpu_relax解析
    hadoop开发者第三期
    Hadoop开发者入门专刊
    Hadoop源代码eclipse编译指南
    高效的使用stl::map和std::set
    配置VIM语法高亮及自动缩进
  • 原文地址:https://www.cnblogs.com/elontian/p/9392201.html
Copyright © 2011-2022 走看看