ogg logdump

软件下载:https://edelivery.oracle.com/EPD/WelcomePage/get_form?ARU_LANG=ZHS

c:\ggs>logdump

Oracle GoldenGate Log File Dump Utility
Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100

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



Logdump 1 >open C:\ggs\dirdat\pt000002
Current LogTrail is C:\ggs\dirdat\pt000002
Logdump 2 >pos 1438
Reading forward from RBA 1438
Logdump 3 >n
Logdump 4 >help

FC [<num> | <string>]     - Edit previous command
HISTORY                   - List previous commands
OPEN | FROM  <filename>   - Open a Log file
RECORD | REC              - Display audit record
NEXT [ <count> ]          - Display next data record
SKIP [ <count> ] [FILTER] - Skip down <count> records
     FILTER               - Apply filter during skip
COUNT                     - Count the records in the file
      [START[time] <timestr>,]
      [END[time] <timestr>,]
      [INT[erval] <minutes>,]
      [LOG[trail] <wildcard-template>,]
      [FILE <wildcard-template>,]
      [DETAIL ]
       <timestr> format is
         [[yy]yy-mm-dd] [hh[:mm][:ss]]
POSITION [ <rba> | FIRST | LAST | EOF ] - Set position in file
         REVerse | FORward              - Set read direction
RECLEN [ <size> ]  - 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>
      [,<filename-template>]
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>
      [,<filename-template>]
         <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 <nnnn>]- 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 [ <filterid> | <ALL> ]
FILTER MATCH     ANY | ALL
FILTER [INClude | EXCLude] <filter options>
   <filter options> are
       RECTYPE  <type number | type name>
       STRING [BOTH] /<text>/ [<column range>]
       HEX      <hex string>  [<column range>]
       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   [<comparison>] <32/64-bit syskey>
       SYSKEYLEN [<comparison>] [<value>]
       TRANSIND [<comparison>] <nn>
       UNDOFLAG [<comparison>] <nn>
       RECLEN   [<comparison>] <nn>
       AUDITRBA [<comparison>] <nnnnnnnn>
       ANSINAME <ansi table name>
       GGSTOKEN <tokenname> [<comparison>] [<tokenvalue>]
       USERTOKEN <tokenname> [<comparison>] [<tokenvalue>]
       CSN | LogCSN [<comparison>] [<value>]
   <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 ( <pri>, <sec> [,<max>])] - Savefile Extent sizes on NSK
   [MEGabytes <nnnn>]             - For extent size calculation
   [TRANSIND <nnn>]               - Set the transind field
   [COMMITTS <nnn>]               - 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 <specifier>]       - sprintf format default %f


Logdump 9 >pos 1438
Reading forward from RBA 1438
Logdump 10 >n

2012/10/17 17:12:46.195.969 Insert               Len    28 RBA 1438
Name: 000.TEST1
After  Image:                                             Partition 4   G  s
 0000 0006 0000 0002 3431 0001 000e 0000 000a 7464 | ........41........td
 6164 6473 3333 3363                               | adds333c

Logdump 17 >n
Logdump 18 >pos 1577
Reading forward from RBA 1577
Logdump 19 >n

2012/10/17 17:14:35.182.695 FieldComp            Len    26 RBA 1577
Name: 000.TEST1
After  Image:                                             Partition 4   G  s
 0000 0004 ffff 0000 0001 000e 0000 000a 6165 6674 | ................aeft
 7474 6173 6466                                    | ttasdf

Logdump 20 >count
** Count begins at RBA 1577
LogTrail C:\ggs\dirdat\pt000002 has 1 records
Total Data Bytes                26
  Avg Bytes/Record              26
FieldComp                        1
After Images                     1

Average of 1 Transactions
    Bytes/Trans .....         74
    Records/Trans ...          1
    Files/Trans .....          1

Logdump 21 >show rectype
LogTrail record types
    1 - Abort                             2 - Commit
    3 - Delete                            4 - EndRollBack
    5 - Insert                            6 - Prepared
    7 - TMF-Shutdown                      8 - TransBegin
    9 - TransRelease                     10 - Update
   11 - UpdateComp                       12 - FileAlter
   13 - FileCreate                       14 - FilePurge
   15 - FieldComp                        16 - FileRename
   17 - AuxPointer                       18 - NetworkCommit
   19 - NetworkAbort                     20 - CurrentPos
   90 - GGSSQLCol                       100 - GGSPurgedata
  108 - GGSPurgedataPartonly            101 - GGSPurgeFile
  102 - GGSCreateFile                   103 - GGSAlterFile
  104 - GGSRenameFile                   105 - GGSSetmode
  107 - GGSControl                      106 - GGSChangeLabel
  115 - GGSPKUpdate                     117 - GGSPKUpdate32
  116 - LargeObject                     132 - Sequence OP
  150 - RestartAbend                    151 - RestartOK
  152 - RecoveryEnd                     160 - DDLOP
  161 - RecordFragment                  200 - GGSBulkio
  201 - GGSFileClose                    202 - GGSLoggerTS
  203 - GGSExtractTS                    204 - GGSCollectTS
  205 - GGSComment                      250 - LibOpenTrace
  251 - LibCloseTrace                   252 - LoggerOpenTrace
  253 - LoggerCloseTrace                254 - LoggerAddedInfo
  249 - LoggerAddedStats                255 - FileHeader

Logdump 22 >scanforendtrans
End of Transaction found at RBA 1577

2012/10/17 17:14:35.182.695 FieldComp            Len    26 RBA 1577
Name: 000.TEST1
After  Image:                                             Partition 4   G  s
 0000 0004 ffff 0000 0001 000e 0000 000a 6165 6674 | ................aeft
 7474 6173 6466                                    | ttasdf

Logdump 23 >detail on

Logdump 24 >


Hdr-Ind: 该值总是E,表示是extract process创建,如果为其他属性,则表示不可用。
UndoFlag:该属性正常值为0,当为1时则表示先前已经成功的记录进行撤销操作。
          这里我不清楚是不是指这种情况:例如一个大事务未commit的情况,数据已经写入
          到redo中,而ogg是读取redo进行同步的,在ogg抽取数据以后这个事务又被rollback了。

RecLength:record buffer长度,单位是bytes
IOType:表示操作类型,该属性有如下几种值:
3 - Delete
5 - Insert
10 - Update(full record)
15 - Update(compressed record)

TransInd:事务记录标志,有如下4种可能属性;

x00 - start of transaction                 
x01 - middle of transaction    
x02 - end of transaction       
x03 - only record in transaction

SyskeyLen:system key长度。如果system key存在,其第一个bytes表示system key记录,否则该值为0.

AuditRBA:事务record commit地址,同一个事务中,该值均相同。goldengate通过auditRBA+IO Time来确定
          一个事务,其值是唯一的。

Continued:该属性有两种值:Y和N,用来定义数据片大大小,通常lob,clob或varchar类型,该值是Y,否则是N。

Partition:该属性是goldengate内部使用的一个标示,并不是指os或数据库层面的逻辑分区和物理分区。windows和unix
           平台下,该属性值总是为4。
           对于Nonstop的记录,该属性的值取决于如下两个方面:
           1)存在Bulk IO操作的情况下,该值表示源端分区已经完成的bulk IO操作的数量。其取值范围为0~15.
           2)对于其他非bulk io操作的nonstop record情况下,该属性取值通常为0或4. 为4的情况,表示该数据为
              FiledComp record格式 (compress存储格式)。

BeforeAfter: 对于update操作,表示该数据是before image还是after image。对于insert操作,总是after images,
              而delete操作总是before images。

IO Time:记录提交时间,同一个事务内的所有记录,该属性值都是相同的,为GMT格式。

OrigNode:Nonstop情况下,表示extract数据抽取端的节点号,整个cluster内,每个节点的节点号都是唯一的。
          该属性取值范围是0~255. 除nonstop之外的其他情况,该属性值为0.

FormatType:表示数据是从事务日志读取还是直接从数据库中获取的。取值为F和R,F表示fetched from database。
            R表示readable in transaction log。

Incomplete:该属性值从10.4版本就已经废弃了,是向前兼容保留的。

AuditPos: 标示extract process在transaction log中的位置。

RecCount:在windows和unix平台下,ogg处理lob时,是将其split成chunk,然后将chunk写入到file中。
          recCount用来表示在读取时对chunk的合并。



对于logdump 看到的record 记录,其实iotype也就4种,3,5,10,15. 其中15表示compress record。
那么如何启用record的压缩存储呢?其实有个参数控制的,那就是auditcompress。

你可能感兴趣的:(ogg logdump)