April 14, 2021

Golden Gate (OGG) Log Dump Utility Commands

Oracle GoldenGate LogDump Utility Commands (21c)

Can we see data in OGG trail files? What is OGG logdump utility?

We can not open Oracle Golden Gate trail files directly and check the data.

logdump utility, in OGG (Oracle GoldenGate) 11g onwards, used to view data from trail files.


With the help of the logdump tool, we can open trail files, read their content, navigate through files, and view transactions at different RBA’s.

logdump > 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
DECRYPT OFF | ON [KEYNAME key_name]  [PROFILE profile_name]  - Decrypt data encrypted with GoldenGate trail encryption.
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
SCANFORMETADATA  (SFMD)   - Find a metadata record
      [DDR] | [TDR]
      [NEXT] | [Index]
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
   [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
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 commands in OGG 21c/19c

./logdump
logdump > env     -- to display current OGG LOGDUMP environment (similar to env command in Linux flavours)

logdump > open filename
logdump > open /ogg/ogg_18_9_15_0_7/srcdir/9p030418
logdump > OPEN ./dirdat/EE000001

logdump > FILEHEADER [on | off | detail]
logdump > FILEHEADER ON
logdump > FILEHEADER OFF
logdump > FILEHEADER DETAIL

logdump > GHDR [on | off]   -- get header, to view record header
logdump > ghdr ON
logdump > ghdr OFF


logdump > HEADERTOKEN {ON | OFF | DETAIL}

logdump > DETAIL [on | off | data]   -- to include column information in Hex and ASCII
logdump > detail on
logdump > detail off
logdump > detail data

logdump > USERTOKEN [detail]   -- to display custom user defined information
logdump > USERTOKEN DETAIL

logdump > GGSTOKEN ON  -- OGG generated tokens. These tokens contain the Transaction ID, Row ID
logdump > GGSTOKEN ON

logdump > RECLEN [<# of bytes>]
logdump > RECLEN 256

logdump > pos RBA        -- to go to specific RBA in a OGG trail file
logdump > pos xxxx
logdump > pos first
logdump > pos 0
logdump > pos last
logdump > pos eof
logdump > pos forward  (or) pos for
logdump > pos reverse  (or) pos rev

logdump > n (or) next               -- will fetch next record in trail file
logdump > nexttrail       -- will close current trail file and open next trail file
logdump > skip [count]
logdump > skip 5

logdump > history

logdump > SFH                 -- scan file header, to find next healthy record
logdump > SCANFORHEADER
logdump > SFET -- Scan for end of the transaction
logdump > SCANFORENDOFTRANSACTION
logdump > SCANFORENDTRANS
logdump > SCANFORENDTR
logdump > SCANFORRBA 321 /home/ogg/dirdat/rt000000
logdump > SCANFORTIME 2018-02-18 13:23:25
logdump > SCANFORTYPE Commit
logdump > SFT 2

logdump > record

logdump > count [detail]    -- to display count summary
logdump > count
logdump > count detail
logdump > COUNT START 2018-04-09 12:00:00 , END 2018-04-11 12:00:00
logdump > COUNT INTERVAL 4
logdump > COUNT LOG ls* 

logdump > filter enable
logdump > filter disable
logdump > filter include iotype insert
logdump > filter include iotype 160
logdump > FILTER INCLUDE FILENAME APP.DETAIL
logdump > FILTER INCLUDE FILENAME [SCHEMA].[TABLE]; FILTER RECTYPE 5; FILTER INCLUDE IOTYPE INSERT
logdump > filter show
logdump > FILTER CLEAR

logdump > SHOW RECTYPE
logdump > SHOW OPEN
logdump > SHOW FILTER
logdump > clear

logdump > TRANSHIST 200
logdump > TRANSRECLIMIT 50

logdump > SAVE [file] [n] RECORDS
logdump > SAVE /home/ogg/dirdat/rt000001 10 records nocomment

logdump > LOG TO filename.txt      -- similar to spool command in SQL*Plus
logdump > LOG STOP

logdump > WRITELOG "text"     -- similar to spool command in SQL*Plus

logdump > ENCRYPT 123456789

logdump > DECRYPT OFF | ON [KEYNAME key_name] [PROFILE profile_name] - Decrypt data encrypted with GoldenGate trail encryption.
logdump > DECRYPT ON
logdump > DECRYPT OFF

logdump > DUMP 300

logdump > quit
logdump > exit


Related Oracle Articles:  
ggsci - Oracle GoldenGate (OGG)   Oracle Golden Gate (OGG) Interview Questions and answers


No comments:

Post a Comment