Logdump enables you to search for, filter, view, and save data that is stored in a trail or extract file.
查看记录
[oracle@odb07 ogg]$ ./logdump Oracle GoldenGate Log File Dump Utility for Oracle Version 12.2.0.1.1 OGGCORE_12.2.0.1.0_PLATFORMS_151211.1401 Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved. Logdump 65 >open /u01/app/oracle/product/ogg/dirdat/i1000000215 Current LogTrail is /u01/app/oracle/product/ogg/dirdat/i1000000215 Logdump 66 >ghdr on Logdump 67 >headertoken on Logdump 68 >usertoken on Logdump 69 >detail on Logdump 70 >detail data Logdump 71 >n TokenID x46 'F' Record Header Info xff80 Length 1770 TokenID x30 '0' TrailInfo Info x00 Length 832 TokenID x31 '1' MachineInfo Info x00 Length 108 TokenID x32 '2' DatabaseInfo Info x00 Length 362 TokenID x33 '3' ProducerInfo Info x00 Length 119 TokenID x34 '4' ContinunityInfo Info x00 Length 321 TokenID x5a 'Z' Record Trailer Info xff80 Length 1770 2016/07/26 13:14:34.395.885 FileHeader Len 1762 RBA 0 Name: *FileHeader* 3000 0340 3000 0008 4747 0d0a 544c 0a0d 3100 0002 | 0..@0...GG..TL..1... 0005 3200 0004 2000 0000 3300 0008 02f2 5eb6 6eb7 | ..2... ...3.....^.n. 3ced 3400 0030 002e 7572 693a 6f64 6230 313a 3a75 | <.4..0..uri:odb01::u 3031 3a61 7070 3a6f 7261 636c 653a 7072 6f64 7563 | 01:app:oracle:produc 743a 6f67 673a 5248 4e5f 444d 5031 3500 0034 3500 | t:ogg:RHN_DMP15..45. 0030 002e 7572 693a 6f64 6230 313a 3a75 3031 3a61 | .0..uri:odb01::u01:a 7070 3a6f 7261 636c 653a 7072 6f64 7563 743a 6f67 | pp:oracle:product:og Logdump 72 >n TokenID x47 'G' Record Header Info x01 Length 131 TokenID x48 'H' GHDR Info x00 Length 35 TokenID x44 'D' Data Info x00 Length 80 TokenID x5a 'Z' Record Trailer Info x01 Length 131 ___________________________________________________________________ Hdr-Ind : E (x45) Partition : . (x00) UndoFlag : . (x00) BeforeAfter: A (x41) RecLength : 80 (x0050) IO Time : 2016/07/12 10:44:47.757.005 IOType : 170 (xaa) OrigNode : 1 (x01) TransInd : . (x01) FormatType : R (x52) SyskeyLen : 0 (x00) Incomplete : . (x00) DDR/TDR Idx: (001, 000) AuditPos : 11542052 Continued : N (x00) RecCount : 1 (x01) 2016/07/12 10:44:47.757.005 Metadata Len 80 RBA 1770 Name: * DDR Version: 1 Database type: ORACLE Character set ID: UTF-8 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: RHNDB * Logdump 73 >n TokenID x47 'G' Record Header Info x01 Length 1379 TokenID x48 'H' GHDR Info x00 Length 57 TokenID x44 'D' Data Info x00 Length 1306 TokenID x5a 'Z' Record Trailer Info x01 Length 1379 ___________________________________________________________________ Hdr-Ind : E (x45) Partition : . (x00) UndoFlag : . (x00) BeforeAfter: A (x41) RecLength : 1306 (x051a) IO Time : 2016/07/12 16:34:42.662.334 IOType : 170 (xaa) OrigNode : 2 (x02) TransInd : . (x01) FormatType : R (x52) SyskeyLen : 0 (x00) Incomplete : . (x00) DDR/TDR Idx: (001, 001) AuditPos : 12479340 Continued : N (x00) RecCount : 1 (x01) 2016/07/12 16:34:42.662.334 Metadata Len 1306 RBA 1901 Name: SPWUSER.RHNPACKAGEFILE * 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 SPWUSER.RHNPACKAGEFILE Record Length: 1032 Columns: 17 PACKAGE_ID 64 50 0 0 0 1 0 50 50 50 0 0 0 0 1 0 1 2 2 -1 0 0 0 CAPABILITY_ID 64 50 56 0 0 1 0 50 50 50 0 0 0 0 1 0 1 2 2 -1 0 0 0 DEVICE 64 50 112 0 0 1 0 50 50 50 0 0 0 0 1 0 0 2 2 -1 0 0 0 INODE 64 50 168 0 0 1 0 50 50 50 0 0 0 0 1 0 0 2 2 -1 0 0 0 FILE_MODE 64 50 224 0 0 1 0 50 50 50 0 0 0 0 1 0 0 2 2 -1 0 0 0 USERNAME 64 32 280 0 0 1 0 32 32 0 0 0 0 0 1 0 0 0 1 -1 0 0 0 GROUPNAME 64 32 318 0 0 1 0 32 32 0 0 0 0 0 1 0 0 0 1 -1 0 0 0 RDEV 64 50 356 0 0 1 0 50 50 50 0 0 0 0 1 0 0 2 2 -1 0 0 0 FILE_SIZE 64 50 412 0 0 1 0 50 50 50 0 0 0 0 1 0 0 2 2 -1 0 0 0 MTIME 192 29 468 0 0 1 0 29 29 29 0 6 0 0 1 0 0 0 232 -1 0 0 0 CHECKSUM_ID 64 50 500 0 0 1 0 50 50 50 0 0 0 0 1 0 0 2 2 -1 0 0 0 LINKTO 64 256 556 0 0 1 0 256 256 0 0 0 0 0 1 0 0 0 1 -1 0 0 0 FLAGS 64 50 818 0 0 1 0 50 50 50 0 0 0 0 1 0 0 2 2 -1 0 0 0 VERIFYFLAGS 64 50 874 0 0 1 0 50 50 50 0 0 0 0 1 0 0 2 2 -1 0 0 0 LANG 64 32 930 0 0 1 0 32 32 0 0 0 0 0 1 0 0 0 1 -1 0 0 0 CREATED 192 29 968 0 0 1 0 29 29 29 0 6 0 0 1 0 0 0 232 -1 0 0 0 MODIFIED 192 29 1000 0 0 1 0 29 29 29 0 6 0 0 1 0 0 0 232 -1 0 0 0 End of definition Logdump 74 >n TokenID x47 'G' Record Header Info x01 Length 345 TokenID x48 'H' GHDR Info x00 Length 36 TokenID x44 'D' Data Info x00 Length 265 TokenID x54 'T' GGS Tokens Info x00 Length 24 TokenID x5a 'Z' Record Trailer Info x01 Length 345 ___________________________________________________________________ Hdr-Ind : E (x45) Partition : . (x0c) UndoFlag : . (x00) BeforeAfter: A (x41) RecLength : 265 (x0109) IO Time : 2016/07/26 13:23:33.321.599 IOType : 5 (x05) OrigNode : 255 (xff) TransInd : . (x01) FormatType : R (x52) SyskeyLen : 0 (x00) Incomplete : . (x00) AuditRBA : 2286 AuditPos : 24811252 Continued : N (x00) RecCount : 1 (x01) 2016/07/26 13:23:33.321.599 Insert Len 265 RBA 3280 Name: SPWUSER.RHNPACKAGEFILE (TDR Index: 1) After Image: Partition 12 G m 0000 0009 0000 0005 3431 3534 3600 0100 0c00 0000 | ........41546....... 0831 3039 3631 3531 3400 0200 0500 0000 0131 0003 | .10961514........1.. 0009 0000 0005 3139 3235 3400 0400 0900 0000 0531 | ......19254........1 3638 3737 0005 0008 0000 0004 726f 6f74 0006 0008 | 6877........root.... 0000 0004 726f 6f74 0007 0005 0000 0001 3000 0800 | ....root........0... 0800 0000 0434 3039 3600 0900 1f00 0032 3031 332d | .....4096......2013- 3132 2d31 333a 3135 3a32 313a 3536 2e30 3030 3030 | 12-13:15:21:56.00000 Column 0 (x0000), Len 9 (x0009) 0000 0005 3431 3534 36 | ....41546 Column 1 (x0001), Len 12 (x000c) 0000 0008 3130 3936 3135 3134 | ....10961514 Column 2 (x0002), Len 5 (x0005) 0000 0001 31 | ....1 Column 3 (x0003), Len 9 (x0009) 0000 0005 3139 3235 34 | ....19254 Column 4 (x0004), Len 9 (x0009) 0000 0005 3136 3837 37 | ....16877 Column 5 (x0005), Len 8 (x0008) 0000 0004 726f 6f74 | ....root Column 6 (x0006), Len 8 (x0008) 0000 0004 726f 6f74 | ....root Column 7 (x0007), Len 5 (x0005) 0000 0001 30 | ....0 Column 8 (x0008), Len 8 (x0008) 0000 0004 3430 3936 | ....4096 Column 9 (x0009), Len 31 (x001f) 0000 3230 3133 2d31 322d 3133 3a31 353a 3231 3a35 | ..2013-12-13:15:21:5 362e 3030 3030 3030 3030 30 | 6.000000000 Column 10 (x000a), Len 4 (x0004) ffff 0000 | .... Column 11 (x000b), Len 4 (x0004) ffff 0000 | .... Column 12 (x000c), Len 5 (x0005) 0000 0001 30 | ....0 Column 13 (x000d), Len 14 (x000e) 0000 000a 3432 3934 3936 3732 3633 | ....4294967263 Column 14 (x000e), Len 4 (x0004) ffff 0000 | .... Column 15 (x000f), Len 31 (x001f) 0000 3230 3136 2d30 372d 3236 3a30 353a 3134 3a32 | ..2016-07-26:05:14:2 392e 3534 3834 3338 3030 30 | 9.548438000 Column 16 (x0010), Len 31 (x001f) 0000 3230 3136 2d30 372d 3236 3a30 353a 3134 3a32 | ..2016-07-26:05:14:2 392e 3534 3839 3231 3030 30 | 9.548921000
查看trail文件的总记录数
Logdump 78 >count ** Count begins at RBA 3280 LogTrail /u01/app/oracle/product/ogg/dirdat/i1000000215 has 145742 records Total Data Bytes 36538835 Avg Bytes/Record 250 Delete 27613 Insert 67738 Update 49834 GGSPKUpdate 107 LargeObject 395 Metadata Records 55 Before Images 27613 After Images 118074 Average of 70155 Transactions Bytes/Trans ..... 620 Records/Trans ... 2 Files/Trans ..... 0 ....... SPWUSER.RHNVIRTUALINSTANCEINFO Partition 0 Total Data Bytes 648 Avg Bytes/Record 648 Metadata Records 1 SPWUSER.RHNVIRTUALINSTANCEINFO Partition 12 Total Data Bytes 122 Avg Bytes/Record 122 Insert 1 After Images 1
查看环境变量
Logdump 76 >env Version : Linux, x64, 64bit (optimized) on Dec 11 2015 16:52:17 Current Directory : /u01/app/oracle/product/ogg LogTrail : /u01/app/oracle/product/ogg/dirdat/i1000000215 Trail Format : New Trail Format Version: RELEASE 12.2 Objectdefs Included : Yes End of File : 49999890 Current Position : 3280 Forward Next Position : 3280 Last Modtime : 2016/07/27 20:14:03.000.000 Display RecLen : 140 Logtrail Filter : On Show Ghdr : On Detail : Data HeaderToken : On UserToken : On Trans History : 0 Transactions, Records 100, Bytes 100000 LargeBlock I/O : On, Blocksize 57344 Local System : LittleEndian Metadata Byte Order : BigEndian Logtrail Data : BigEndian/ASCII Logtrail Headers : ASCII Dump : ASCII Savefile comments : Off Timeoffset : LOCAL Scan Notify Interval: 10000 records, Scrolling On
转载于:https://blog.51cto.com/candon123/1831818