欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

Logdump

程序员文章站 2024-01-05 14:01:58
...

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 forma

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 – Open a Log file
RECORD | REC - Display audit record
NEXT [ ] - Display next data record
SKIP [ ] [FILTER] – Skip down records
FILTER – Apply filter during skip
COUNT – Count the records in the file
[START[time] ,]
[END[time] ,]
[INT[erval] ,]
[LOG[trail] ,]
[FILE ,]
[DETAIL ]
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 - Set data display length
SCANFORHEADER (SFH) [PREV] - Search for the start of a header
SCANFORTYPE (SFT) – Find the next record of
|
[,]
SCANFORRBA (SFR) – Find the next record with
- syskey = -1 scans for next record
,
SCANFORTIME (SFTS) – Find the next record with timestamp

[,]
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

]
HEX [

]
TRANSID
FILENAME
PROCESS
INT16
INT32
INT64
STARTTIME
ENDTIME
SYSKEY []
SYSKEYLEN [] []
TRANSIND []
UNDOFLAG []
RECLEN []
AUDITRBA []
ANSINAME
GGSTOKEN [] []
USERTOKEN [] []
CSN | LogCSN [] []

:, ie 0:231

=, ==, !=, , , = EQ, GT, LE, GE, LE, NE
X [string] - Execute
TRANSHIST nnnn - Set size of transaction history
TRANSRECLIMIT nnnn - Set low record count threshold
TRANSBYTELIMIT nnnn – Set low byte count threshold
LOG {STOP} | { [TO] } – Write a session log
BEGIN – Set next read position using a timestamp
SAVEFILECOMMENT on | OFF - Toggle comment records in a savefile
SAVE [!] - Write data to a savefile
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 - 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 >

推荐阅读