Logdump

You can use the GoldenGate Logdump utility to view records in the GoldenGate trail files. The Logdump
utility is part of the regular GoldenGate software installation. Logdump lets you view the unstructured
trail data in hex and ASCII format and count the number of records in the trail for debugging purposes.
You can also filter the trail for desired records and save them to a new trail for reprocessing if needed.

 

how to use logdump:

[oracle@ogg1 ogg]$ ./logdump

Oracle GoldenGate Log File Dump Utility for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230

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


 
Logdump 44 >help

FC [ | ]     – Edit previous command 
HISTORY                   – List previous commands 
OPEN | FROM  <filename>   – Open a Log file    
RECORD | REC              - Display audit record  
NEXT [ 
]          - Display next data record 
SKIP [ 
] [FILTER] – Skip down <count> records 
     FILTER               – Apply filter during skip 
COUNT                     – Count the records in the file 
      [START[time] 
,]  
      [END[time] 
,]  
      [INT[erval] 
,]  
      [LOG[trail] 
,]  
      [FILE 
,]  
      [DETAIL ] 
       <timestr> format is  
         [[yy]yy-mm-dd] [hh[:mm][:ss]]   
POSITION [ 
| FIRST | LAST | EOF ] – Set position in file 
         REVerse | FORward              - Set read direction 
RECLEN [ 
]  - Sets max output length 
EXIT | QUIT        - Exit the program 
FILES | FI | DIR   – Display filenames  
ENV                - Show current settings 
VOLUME | VOL | V   – Change default volume 
DEBUG              - Enter the debugger 
GHDR  ON | OFF     – Toggle GHDR display  
DETAIL ON | OFF | DATA – Toggle detailed data display  
RECLEN <nnn>        - Set data display length  
SCANFORHEADER (SFH)  [PREV]  - Search for the start of a header 
SCANFORTYPE   (SFT) – Find the next record of <TYPE>  
      <typename> | <typenumber> 
      [,
]  
SCANFORRBA    (SFR) – Find the next record with <SYSKEY>  
      <syskey>                - syskey = -1 scans for next record  
      ,<filename-template>  
SCANFORTIME  (SFTS) – Find the next record with timestamp 
      <date-time string> 
      [,
]  
         <date-time string> format is  
           [[yy]yy-mm-dd] [hh[:mm][:ss]]   
SCANFORENDTRANS (SFET) – Find the end of the current transaction  
SCANFORNEXTTRANS (SFNT) – Find start of the next transaction  
SHOW <option>       – Display internal information 
      [OPEN]        - list open files  
      [TIME]        - print current time in various formats 
      [ENV]         – show current environment  
      [RECTYPE]     – show list of record types 
      [FILTER]      - show active filter items  
BIO  <option>       – Set LargeBlock I/O info 
      [ON]          - Enable LargeBlock I/O (default)  
      [OFF]         – Disable LargeBlock I/O  
      [BLOCK 
]- Set LargeBlock I/O size  
TIMEOFFSET <option> – Set the time offset from GMT 
      [LOCAL]            - Use local time 
      [GMT]              - Use GMT time 
      [GMT +/- hh[:mm]]  - Offset +/- from GMT 
FILTER SHOW       
FILTER ENABLE | ON   – Enable filtering  
FILTER DISABLE | OFF – Disable filtering  
FILTER CLEAR [ 
]           
FILTER MATCH     ANY | ALL                    
FILTER [INClude | EXCLude] <filter options>   
   <filter options> are                       
       RECTYPE  <type number | type name>     
       STRING [BOTH] /
/ [


       HEX      <hex string>  [


       TRANSID  <TMF transaction identifier> 
       FILENAME <filename template>           
       PROCESS  <processname template>        
       INT16    <16-bit integer>              
       INT32    <32-bit integer>              
       INT64    <64-bit integer>              
       STARTTIME <date-time string>           
       ENDTIME   <date-time string>           
       SYSKEY   [
] <32/64-bit syskey> 
       SYSKEYLEN [
] [ ]  
       TRANSIND [
] <nn>         
       UNDOFLAG [
] <nn>         
       RECLEN   [
] <nn>         
       AUDITRBA [
] <nnnnnnnn>   
       ANSINAME <ansi table name> 
       GGSTOKEN <tokenname> [
] [
       USERTOKEN <tokenname> [
] [
       CSN | LogCSN [
] [
   <column range> 
       <start column>:<end column>, ie  0:231 
   <comparison> 
       =, ==, !=, <>, <, >, <=, >=  EQ, GT, LE, GE, LE, NE 
X <program> [string]  - Execute <program> 
TRANSHIST nnnn        - Set size of transaction history 
TRANSRECLIMIT nnnn    - Set low record count threshold 
TRANSBYTELIMIT nnnn   – Set low byte count threshold 
LOG {STOP} | { [TO] <filename> } – Write a session log  
BEGIN <date-time>     – Set next read position using a timestamp  
SAVEFILECOMMENT on | OFF  - Toggle comment records in a savefile 
SAVE <savefilename> [!] <options>  - Write data to a savefile 
   <options> are                              
   nnn RECORDS | nnn BYTES  
   [NOCOMMENT]  - Suppress the Comment header/trailer recs, Default 
   [COMMENT]    - Insert Comment header/trailer recs 
   [OLDFORMAT]  - Force oldformat records 
   [NEWFORMAT]  - Force newformat records 
   [TRUNCATE ]  - purgedata an existing savefile 
   [EXT ( 
[, ])] – Savefile Extent sizes on NSK 
   [MEGabytes 
]             – For extent size calculation 
   [TRANSIND 
]               – Set the transind field 
   [COMMITTS 
]               – Set the committs field 
USERTOKEN     on  | OFF | detail  - Show user token info 
HEADERTOKEN   on  | OFF | detail  - Show header token info 
GGSTOKEN      on  | OFF | detail  - Show GGS token info 
FILEHEADER    on  | OFF | detail  - Display file header contents  
ASCIIHEADER   ON  | off           – Toggle header charset 
EBCDICHEADER  on  | OFF           – Toggle header charset 
ASCIIDATA     ON  | on            - Toggle user data charset 
EBCDICDATA    on  | OFF           – Toggle user data charset 
ASCIIDUMP     ON  | off           – Toggle charset for hex/ascii display 
EBCDICDUMP    on  | OFF           – Toggle charset for hex/ascii display 
TRAILFORMAT   old | new           – Force trail type 
PRINTMXCOLUMNINFO  on | OFF       – Toggle SQL/MX columninfo display 
TMFBEFOREIMAGE     on | OFF       – Toggle display of TMF before images 
FLOAT  <value>                    - Interpret a floating point number 
       [FORMAT 
]       – sprintf format default %f 
  
Logdump 45 >
Logdump 45 >history
23> n
24> n
25> n
26> n
27> n
28> n
29> open
30> open /opt/ogg/dirdat/k1000000
31> ghdr on
32> detail on
33> dat
34> detail data
35> usertoken on
36> n
37> sfh
38> filter include filename zbdba.test;
39> n
40> n
41> filter clear
42> env
43> fileheader detail
44> help
45> history

 

 

Logdump 50 >open ./dirdat/k1000005
Current LogTrail is /opt/ogg/dirdat/k1000005 

After you open the trail file, you need to turn on some useful features to make full use of the
Logdump utility. The first command is GHDR ON. It enables display of the record header for the
transactions in the trail file for Oracle GoldenGate:
Logdump 51 >ghdr on

Next, you need to toggle the option for viewing the hex and ASCII values for trailfile data. To do so,
execute the detail data command:
Logdump 52 >detail data

Now you can move to the next record in the trail file by using the next command in Logdump. When
you issue the next command, Logdump moves forward one record:
Logdump 53 >next

2014/09/09 21:05:02.655.182 FileHeader           Len  1007 RBA 0 
Name: *FileHeader* 
 3000 0196 3000 0008 4747 0d0a 544c 0a0d 3100 0002 | 0…0…GG..TL..1…  
 0003 3200 0004 2000 0000 3300 0008 02f2 28df 1908 | ..2… …3…..(…  
 bace 3400 0013 0011 7572 693a 6f67 6731 3a3a 6f70 | ..4…..uri:ogg1::op  
 743a 6f67 6736 0000 1a00 182f 6f70 742f 6f67 672f | t:ogg6…../opt/ogg/  
 6469 7264 6174 2f6b 3130 3030 3030 3537 0000 0101 | dirdat/k10000057….  
 3800 0004 0000 0005 39ff 0008 0000 0000 0000 0000 | 8…….9………..  
 3a00 0081 0731 3433 3339 3539 0000 0000 0000 0000 | :….1433959……..  
 
Logdump 54 >n
___________________________________________________________________ 
Hdr-Ind    :     E  (x45)     Partition  :     .  (x00)  
UndoFlag   :     .  (x00)     BeforeAfter:     A  (x41)  
RecLength  :     0  (x0000)   IO Time    : 2014/09/09 21:05:02.628.813   
IOType     :   150  (x96)     OrigNode   :     0  (x00) 
TransInd   :     .  (x03)     FormatType :     R  (x52) 
SyskeyLen  :     0  (x00)     Incomplete :     .  (x00) 
AuditRBA   :          0       AuditPos   : 0 
Continued  :     N  (x00)     RecCount   :     0  (x00) 

2014/09/09 21:05:02.628.813 RestartAbend         Len     0 RBA 1015 
Name:  
After  Image:                                             Partition 0   G  s   
   
Logdump 55 >n
___________________________________________________________________ 
Hdr-Ind    :     E  (x45)     Partition  :     .  (x04)  
UndoFlag   :     .  (x00)     BeforeAfter:     B  (x42)  
RecLength  :    46  (x002e)   IO Time    : 2014/09/09 23:14:09.000.000   
IOType     :     3  (x03)     OrigNode   :   255  (xff) 
TransInd   :     .  (x03)     FormatType :     R  (x52) 
SyskeyLen  :     0  (x00)     Incomplete :     .  (x00) 
AuditRBA   :         30       AuditPos   : 24111432 
Continued  :     N  (x00)     RecCount   :     1  (x01) 

2014/09/09 23:14:09.000.000 Delete               Len    46 RBA 1074 
Name: OGG.GGS_MARKER 
Before Image:                                             Partition 4   G  s   
 0000 0008 0000 0004 3130 3031 0001 0005 0000 0001 | ……..1001……..  
 3200 0200 1500 0032 3031 342d 3039 2d30 3420 3032 | 2……2014-09-04 02  
 3a33 373a 3331                                    | :37:31  
Column     0 (x0000), Len     8 (x0008)  
 0000 0004 3130 3031                               | ….1001  
Column     1 (x0001), Len     5 (x0005)  
 0000 0001 32                                      | ….2  
Column     2 (x0002), Len    21 (x0015)  
 0000 3230 3134 2d30 392d 3034 2030 323a 3337 3a33 | ..2014-09-04 02:37:3  
 31                                                | 1  
   
Logdump 56 >n
___________________________________________________________________ 
Hdr-Ind    :     E  (x45)     Partition  :     .  (x04)  
UndoFlag   :     .  (x00)     BeforeAfter:     B  (x42)  
RecLength  :    46  (x002e)   IO Time    : 2014/09/09 23:44:11.000.000   
IOType     :     3  (x03)     OrigNode   :   255  (xff) 
TransInd   :     .  (x03)     FormatType :     R  (x52) 
SyskeyLen  :     0  (x00)     Incomplete :     .  (x00) 
AuditRBA   :         30       AuditPos   : 24441148 
Continued  :     N  (x00)     RecCount   :     1  (x01) 

2014/09/09 23:44:11.000.000 Delete               Len    46 RBA 1235 
Name: OGG.GGS_MARKER 
Before Image:                                             Partition 4   G  s   
 0000 0008 0000 0004 3135 3137 0001 0005 0000 0001 | ……..1517……..  
 3200 0200 1500 0032 3031 342d 3039 2d30 3420 3232 | 2……2014-09-04 22  
 3a33 363a 3036                                    | :36:06  
Column     0 (x0000), Len     8 (x0008)  
 0000 0004 3135 3137                               | ….1517  
Column     1 (x0001), Len     5 (x0005)  
 0000 0001 32                                      | ….2  
Column     2 (x0002), Len    21 (x0015)  
 0000 3230 3134 2d30 392d 3034 2032 323a 3336 3a30 | ..2014-09-04 22:36:0  
 36                                                | 6  
   
Logdump 57 >


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: logdump线程是指用于将系统日志输出到磁盘文件中的线程。在一个运行中的系统中,有很多进程在同时运行,每个进程都可能会产生大量的日志信息,如果将这些日志信息全部输出到控制台上,会给系统带来很大的压力,并且也不方便进行日后的分析和查找。因此,logdump线程的作用就是将这些日志信息输出到磁盘文件中,以便于日后的分析和查找。通常,logdump线程会将日志信息分类存储,比如按照时间、进程等方式进行分类,这样可以更方便地进行日后的查找和分析。 ### 回答2: logdump线程是指在计算机系统中用于将日志数据从存储设备中读取出来并进行解析和处理的线程。 在计算机系统中,为了实现数据的持久化和可追踪性,往往需要将重要的事件和操作记录下来,这些记录被称为日志。而在很多场景下,需要对这些日志进行分析和处理,以便进行故障排除、性能监控、数据分析等。 而logdump线程就是负责实现这一功能的线程。它的主要作用有以下几点: 1. 读取日志数据:logdump线程负责从存储设备中读取日志数据,获取到存储在其中的日志记录。 2. 解析日志记录:logdump线程对读取到的日志数据进行解析,将其中的各个字段和信息提取出来,以便后续的处理。 3. 过滤和筛选:logdump线程可以根据事先设定的规则和条件,对日志数据进行过滤和筛选,只提取出符合条件的日志记录,从而减少后续处理的数据量。 4. 处理和分析:logdump线程将解析和筛选后的日志记录交给后续的处理模块进行进一步的处理和分析。比如可以将其存储到数据库中、生成报表、进行可视化展示等。 5. 错误处理:logdump线程还负责处理日志读取和解析过程中可能出现的错误和异常情况,保证系统的稳定和可靠性。 综上所述,logdump线程是在计算机系统中实现日志读取、解析和处理的关键环节,它的作用是将存储设备中的日志数据提取出来并进行相应的处理,以便实现故障排除、性能监控、数据分析等功能。 ### 回答3: logdump线程是一种在电子设备或计算机系统中常见的线程类型,其主要作用是将日志数据从内存中的缓冲区的存储位置转储到外部设备或文件中。 在计算机系统或软件应用程序中,日志记录是一种非常重要的功能。日志记录可以帮助开发人员或系统管理员了解系统的运行状态、错误和异常情况,从而对系统进行监控、调试和故障排除。然而,由于日志数据的产生速度往往很快,如果直接将日志数据写入外部设备或文件,会大大降低系统的性能和响应速度。因此,logdump线程的作用就是将日志数据从内存中的缓冲区转储到外部设备或文件中。 logdump线程通常会有以下几个特点和作用: 1. 提高系统性能:通过将日志数据存储在内存缓冲区而不是直接写入外部设备或文件,可以减少系统的I/O操作,提高系统的性能和响应速度。 2. 确保数据完整性:logdump线程可以确保将缓冲区中的所有日志数据都完整地写入外部设备或文件中,避免数据丢失或不一致的问题。 3. 控制日志存储的时机:logdump线程可以根据系统的负载情况或日志记录的重要性来决定何时将日志数据转储到外部设备或文件中,从而更好地控制日志存储的时机。 总之,logdump线程的作用是优化系统的日志记录功能,提高系统性能和数据完整性,并有效控制日志数据的存储时机。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值