iis服务器助手广告广告
返回顶部
首页 > 资讯 > 数据库 >ogg之replicat进程跳过事务的方法
  • 157
分享到

ogg之replicat进程跳过事务的方法

2024-04-02 19:04:59 157人浏览 八月长安
摘要

本文主要讲述: 1.ogg 如何跳过事务 2.logdump 在事务寻找中的关键作用   复制进程 abended GGSCI (ORALTDB.ea

本文主要讲述:

1.ogg 如何跳过事务

2.logdump 在事务寻找中的关键作用

 

复制进程 abended

GGSCI (ORALTDB.eastmoney.com.sh) 12>   info all

 

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

 

MANAGER     RUNNING                                          

REPLICAT    ABENDED     REP_MI01    00:00:00      00:00:25

 

 

如果要使用 logdump 的话,需要知道进程正在处理的文件,如何获取这个文件呢?

对于抽取进程来说:

1. 操作系统上最后一个 trail 文件一定是 abended 时正在处理的文件

2. 通过命令查看 info < 进程名 >,detail

对于复制进程来说,操作系统最后一个文件不一定是 replicat 进程正在处理的文件了:

1.info < 进程名 >

2.info < 进程名 >,detail

 

 

查看复制进程当前处理的文件和处理到的 RBA 地址

GGSCI (ORALTDB.eastmoney.com.sh) 13>   info REP_MI01   

 

REPLICAT     REP_MI01  Last Started   2018-12-13 15:07   Status ABENDED

Checkpoint Lag       00:00:00 (updated 00:00:35 aGo)

Log Read Checkpoint  File /u01/app/oracle/products/ogg/dirdat/pump_mi01/ p1000000012

                     2018-12-13   15:04:13.394312  RBA 18728239

 

 

                   

                   

logdump 工具

[ogg@ORALTDB ogg]$ ./logdump

 

Oracle GoldenGate Log File Dump Utility   for Oracle

Version 12.2.0.1.170221   OGGCORE_12.2.0.1.0OGGBP_PLATFORMS_170123.1033

 

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

 

 

 

 

2018-12-13 15:10:33  WARNING OGG-10173  (GLOBALS) line 1: Parsing error,   [NOUSEANSIsqlQUOTES] is deprecated.

 

2018-12-13 15:10:33  INFO      OGG-06323  NOUSEANSISQLQUOTES is   specified. Non ANSI SQL string syntax is used for parameter.

Logdump 1 > open   /u01/app/oracle/products/ogg/dirdat/pump_mi01/p1000000012

Current LogTrail is   /u01/app/oracle/products/ogg/dirdat/pump_mi01/p1000000012

Logdump 2 > pos   18728239  --info 命令查出的 rba 地址

Reading forward from RBA 18728239

Logdump 3 >detail data

Logdump 4 >ggstoken detail

Logdump 5 >ghdr on

Logdump 6 >n

___________________________________________________________________  

Hdr-Ind      :     E  (x45)       Partition  :     .    (x00) 

UndoFlag     :     .  (x00)       BeforeAfter:     A  (x41)   

RecLength    :    82  (x0052)     IO Time    : 2018/12/13   15:07:30.282.502  

IOType       :   170  (xaa)       Orignode   :     1    (x01)

TransInd     :     .  (x03)       FormatType :     R    (x52)

SyskeyLen    :     0  (x00)       Incomplete :     .  (x00)

DDR/TDR Idx:   (002, 000)     AuditPos   : 34596880

Continued    :     N  (x00)       RecCount   :     1    (x01)

 

2018/12/13 15:07:30.282.502 Metadata             Len 82 RBA 18728239

Name:   

*

DDR Version: 1

Database type: ORACLE

Character set ID: zhs16gbk

National character set ID: UTF-16

Locale: neutral

Case sensitivity: 14 14 14 14 14 14 14 14   14 14 14 14 11 14 14 14

TimeZone: GMT

Global name: QUALITY

*

 

注意 TransInd :

(x00) 事务开始

(x01) 事务中

(x02) 事务最后

(x03) 单条事务

 

直接跳到当前事务的最后一条

Logdump 9 > sfet

End of Transaction found at RBA 49635302

___________________________________________________________________  

Hdr-Ind      :     E  (x45)       Partition  :     .    (x0c) 

UndoFlag     :     .  (x00)       BeforeAfter:     B  (x42)   

RecLength    :   259  (x0103)     IO Time    : 2018/12/13   15:07:26.016.944  

IOType       :     3  (x03)       OrigNode   :   255    (xff)

TransInd     :     .  (x02)       FormatType :     R  (x52)

SyskeyLen    :     0  (x00)       Incomplete :     .  (x00)

AuditRBA     :        942       AuditPos   : 98381560

Continued    :     N  (x00)       RecCount   :     1    (x01)

 

2018/12/13 15:07:26.016.944 Delete               Len   259 RBA 49635302

Name: MING.T4  (TDR Index: 2)

Before Image:                                               Partition 12   G  e  

 0000 0007 0000 0003 5359 5300 0100 2200 0000   1e2f | ........SYS..."..../ 

 3837 3638 6634 3335 5f54 6578 7446 6965 6c64   4163 | 8768f435_TextFieldAc 

 6365 7373 6962 6c65 4100 0200 04ff ff00 0000   0300 | cessibleA........... 

 0900 0000 0533 3732 3932 0004 0004 ffff 0000   0005 | .....37292.......... 

 000e 0000 000a 4a41 5641 2043 4c41 5353 0006   0015 | ......JAVA CLASS.... 

 0000 3230 3134 2d30 372d 3037 3a30 363a 3036   3a34 | ..2014-07-07:06:06:4 

 3200 0700 1500 0032 3031 372d 3131 2d30 373a   3136 | 2......2017-11-07:16 

Column       0 (x0000), Len     7   (x0007) 

 0000 0003 5359 53                                 | ....SYS 

Column       1 (x0001), Len    34   (x0022) 

 0000 001e 2f38 3736 3866 3433 355f 5465 7874   4669 | ..../8768f435_TextFi 

 656c 6441 6363 6573 7369 626c 6541                | eldAccessibleA 

Column       2 (x0002), Len     4   (x0004) 

 ffff   0000                                           | .... 

Column       3 (x0003), Len     9   (x0009) 

 0000 0005 3337 3239 32                            | ....37292 

Column       4 (x0004), Len     4   (x0004) 

 ffff 0000                                         | ....   

Column       5 (x0005), Len    14   (x000e) 

 0000 000a 4a41 5641 2043 4c41 5353                | ....JAVA CLASS 

Column       6 (x0006), Len    21   (x0015) 

 0000 3230 3134 2d30 372d 3037 3a30 363a 3036   3a34 | ..2014-07-07:06:06:4 

 32                                                  | 2 

Column       7 (x0007), Len    21   (x0015) 

 0000 3230 3137 2d31 312d 3037 3a31 363a 3433   3a32 | ..2017-11-07:16:43:2 

 32                                                  | 2 

Column       8 (x0008), Len    23   (x0017) 

 0000 0013 3230 3134 2d30 372d 3037 3a30 363a   3036 | ....2014-07-07:06:06 

 3a34 32                                           |   :42 

Column       9 (x0009), Len     9   (x0009) 

 0000 0005 5641 4c49 44                            | ....VALID 

Column      10 (x000a), Len     5   (x0005) 

 0000 0001 4e                                      |   ....N 

Column      11 (x000b), Len     5   (x0005) 

 0000 0001 4e                                      |   ....N 

Column      12 (x000c), Len     5   (x0005) 

 0000 0001 4e                                      |   ....N 

Column      13 (x000d), Len     5   (x0005) 

 0000 0001 31                                      |   ....1 

Column      14 (x000e), Len     4   (x0004) 

 ffff 0000                                         | .... 

Column      15 (x000f), Len     8   (x0008) 

 0000 0004 4e4f 4e45                               |   ....NONE 

Column      16 (x0010), Len     4   (x0004) 

 ffff 0000                                         |   .... 

Column      17 (x0011), Len     5   (x0005) 

 0000 0001 59                                      |   ....Y 

 

GGS tokens:

TokenID x52 'R' ORAROWID         Info x00  Length     20

 4141 4169 3049 4141 4a41 4141 4833 2f41 4139   0001 | AAAi0IAAJAAAH3/AA9.. 

 

 

看到 TransInd   :     .  (x02)

说明这是该事务的最后一条

下一个事务或者 DDL :

Logdump 18 >n

___________________________________________________________________  

Hdr-Ind      :     E  (x45)       Partition  :     .    (x00) 

UndoFlag     :     .  (x00)       BeforeAfter:     A  (x41)   

RecLength    :   260  (x0104)     IO Time    : 2018/12/13 15:24:48.500.917  

IOType       :   170  (xaa)       OrigNode   :     2    (x02)

TransInd     :     .  (x03)       FormatType :     R  (x52)

SyskeyLen    :     0  (x00)       Incomplete :     .  (x00)

DDR/TDR Idx:   (002, 003)     AuditPos   : 564872

Continued    :     N  (x00)       RecCount   :     1    (x01)

 

2018/12/13 15:24:48.500.917 Metadata             Len 260   RBA 49635641

Name: MING.TEST1

*

 1)Name          2)Data Type        3)External Length  4)Fetch Offset      5)Scale         6)Level

 7)Null          8)Bump if Odd      9)Internal Length 10)Binary Length    11)Table Length 12)Most Sig DT

13)Least Sig DT 14)High Precision  15)Low Precision   16)Elementary Item  17)Occurs       18)Key Column

19)Sub DataType 20)Native DataType   21)Character Set   22)Character Length   23)LOB Type     24)Partial Type

*

TDR version: 1

Definition for table MING.TEST1

Record Length: 134

Columns: 3

A          64     50        0    0  0 1 0     50       50     50 0 0 0 0 1    0 1     2    2       -1        0 0 0

EUTIME    192     19       56    0  0 1 0     19       19     19 0 5 0 0 1    0 0     0   12       -1        0 0 0

B          64     50       78    0  0 1 0     50       50     50 0 0 0 0 1    0 0     2    2       -1        0 0 0

End of definition

 

 

 

可以看到当前 TransInd 是 (x03) ,说明上个事务结束后,新事务是一个单条事务,这个事务的 RBA 就是我们在寻找的 extrba 的值

当前打开的是 /u01/app/oracle/products/ogg/dirdat/pump_mi01/p1000000012 ,所以 extseqno 是 12

 

GGSCI (ORALTDB.eastmoney.com.sh) 2> alter replicat rep_mi01,extseqno 12,extrba 49635641

 

2018-12-13 15:31:45  INFO      OGG-06594  Replicat REP_MI01 has   been altered through GGSCI. Even the start up position might be updated,   duplicate suppression remains active in next startup. To override duplicate   suppression, start REP_MI01 with NOFILTERDUPTRANSACTIONS option.

 

REPLICAT altered.

 

GGSCI (ORALTDB.eastmoney.com.sh) 3>   info all

 

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

 

MANAGER     RUNNING                                          

REPLICAT    STOPPED     REP_MI01    00:00:00      00:00:10   

 

 

GGSCI (ORALTDB.eastmoney.com.sh) 4>   start REP_MI01

 

Sending START request to MANAGER ...

REPLICAT REP_MI01 starting

 

 

GGSCI (ORALTDB.eastmoney.com.sh) 5>   info all

 

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

 

MANAGER     RUNNING                                          

REPLICAT    RUNNING     REP_MI01    00:00:00      00:00:18 

 

这样就跳过了上一个有问题的事务。


您可能感兴趣的文档:

--结束END--

本文标题: ogg之replicat进程跳过事务的方法

本文链接: https://www.lsjlt.com/news/47902.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • oracle怎么查询当前用户所有的表
    要查询当前用户拥有的所有表,可以使用以下 sql 命令:select * from user_tables; 如何查询当前用户拥有的所有表 要查询当前用户拥有的所有表,可以使...
    99+
    2024-05-15
    oracle
  • oracle怎么备份表中数据
    oracle 表数据备份的方法包括:导出数据 (exp):将表数据导出到外部文件。导入数据 (imp):将导出文件中的数据导入表中。用户管理的备份 (umr):允许用户控制备份和恢复过程...
    99+
    2024-05-15
    oracle
  • oracle怎么做到数据实时备份
    oracle 实时备份通过持续保持数据库和事务日志的副本来实现数据保护,提供快速恢复。实现机制主要包括归档重做日志和 asm 卷管理系统。它最小化数据丢失、加快恢复时间、消除手动备份任务...
    99+
    2024-05-15
    oracle 数据丢失
  • oracle怎么查询所有的表空间
    要查询 oracle 中的所有表空间,可以使用 sql 语句 "select tablespace_name from dba_tablespaces",其中 dba_tabl...
    99+
    2024-05-15
    oracle
  • oracle怎么创建新用户并赋予权限设置
    答案:要创建 oracle 新用户,请执行以下步骤:以具有 create user 权限的用户身份登录;在 sql*plus 窗口中输入 create user identified ...
    99+
    2024-05-15
    oracle
  • oracle怎么建立新用户
    在 oracle 数据库中创建用户的方法:使用 sql*plus 连接数据库;使用 create user 语法创建新用户;根据用户需要授予权限;注销并重新登录以使更改生效。 如何在 ...
    99+
    2024-05-15
    oracle
  • oracle怎么创建新用户并赋予权限密码
    本教程详细介绍了如何使用 oracle 创建一个新用户并授予其权限:创建新用户并设置密码。授予对特定表的读写权限。授予创建序列的权限。根据需要授予其他权限。 如何使用 Oracle 创...
    99+
    2024-05-15
    oracle
  • oracle怎么查询时间段内的数据记录表
    在 oracle 数据库中查询指定时间段内的数据记录表,可以使用 between 操作符,用于比较日期或时间的范围。语法:select * from table_name wh...
    99+
    2024-05-15
    oracle
  • oracle怎么查看表的分区
    问题:如何查看 oracle 表的分区?步骤:查询数据字典视图 all_tab_partitions,指定表名。结果显示分区名称、上边界值和下边界值。 如何查看 Oracle 表的分区...
    99+
    2024-05-15
    oracle
  • oracle怎么导入dump文件
    要导入 dump 文件,请先停止 oracle 服务,然后使用 impdp 命令。步骤包括:停止 oracle 数据库服务。导航到 oracle 数据泵工具目录。使用 impdp 命令导...
    99+
    2024-05-15
    oracle
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作