logdump 学习

logdump是ogg自带的一个用于分析trail文件的工具,该工具还不错,提供了一些列的命令,如下:

Logdump 92 >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 1 >open /u01/ggs/dirdat/ex000019                                                                                                           
  ----打开trail文件  
 
Logdump 1 >ghdr on  
  ---查看header record信息  
 
Logdump 2 >detail on                                                                                                                                   
  ---Column information includes the number and length in hex and ASCII.                                                                                                                                         
 
Logdump 3> DETAIL DATA                                                                                                                                 
  ---To add hex and ASCII data values to the column information:                                                                                                                                                                                                                                                                                                   
 
Logdump 4> USERTOKEN ON                                                                                                                                
  ---view user tokens                                                                                                                                              
 
Logdump 5> RECLEN <length>                                                                                                                             
  ----控制显示的长度                                                                                                                                                
 
Logdump 7> NEXT  or N                                                                                                                                
  ----To go to the first record and then move through records in sequence                                                                                                                                                
 
Logdump 35> POS <rba>                                                                                                                                                                                                                                                                                         
Logdump 36> N                                                                                                                                          
  ----To go to an RBA anywhere in the file                                                                                                                                                     
 
Logdump 37> POS FIRST  或 pos 0                                                                                                                               
  ----查看file中低一条记录                                                                                                                                                    
 
+++++++ 基于表名进行过滤操作                                                                                                                                                                                                                                                                                                   
 
 
Logdump 60> FILTER INCLUDE/EXCLUDE FILENAME <schema>.<table>                                                                                           
Logdump 61> N                                                                                                                                                       
   ----基于某表名进行过滤                                                                                                                                                                                                                                                                             
 
Logdump 62> FILTER CLEAR                                                                                                                               
   ----清除当前的过滤设置                                                                                                                                                                                                                                                                                                           
 
+++++++ 多条件进行过滤                                                                                                                 
 
Logdump 65> FILTER INCLUDE FILENAME <schema>.<table>; FILTER RECTYPE  <record_type>; FILTER MATCH ALL                                                                                                                        
 
 
Logdump 67> COUNT                                                                                                                                      
  ---- 统计当前trail文件的记录                                                                                                                                                   
 
 
+++++++  To save records to a new trail file                                                                                                                  
----保存整个trail文件                                                                                                                                                                                                                                                                                                                                                                                                                                      
Logdump 68> SAVE <file>                                                                                                                                
 
Where: <file> is the name of the new file.                                                                                                             
 
----保存某些record记录                                                                                                                       
 
Logdump 69> SAVE <file> <n> RECORDS                                                                                                                    
 
To close the current file and open the next one in the trail                                                                                           
 
Logdump 70> NEXTTRAIL                                                                                                                                  
 
 
++++++++ To keep a log of your session                                                                                                                        
 
----保存日志                                                                                                                                
Logdump 71> LOG TO <filename>.txt                                                                                                                      
 
----To write text to the log:                                                                                                                          
 
Logdump 72> WRITELOG “<text>”                                                                                                                        
 
Logdump 73> LOG STOP                                                                                                                                   
 
++++++ To see the current Logdump environment                                                                                                               
 
Logdump 74> ENV

下面来尝试一下,如何使用logdump 来分析某个trail文件。

-bash-3.00$ ./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 71 >open ./dirdat/rm000018                                          
Current LogTrail is /home/ggs/ggs_home/dirdat/rm000018                      
Logdump 72 >ghdr on                                                         
Logdump 73 >detail on                                                       
Logdump 74 >detail data                                                     
Logdump 75 >usertoken on                                  
Logdump 84 >FILTER include filename ROGER.T;                                                     
Logdump 85 >next                                                               
___________________________________________________________________            
Hdr-Ind    :     E  (x45)     Partition  :     .  (x04)                        
UndoFlag   :     .  (x00)     BeforeAfter:     B  (x42)                        
RecLength  :   200  (x00c8)   IO Time    : 2012/08/31 07:35:43.060.853         
IOType     :     3  (x03)     OrigNode   :   255  (xff)                        
TransInd   :     .  (x00)     FormatType :     R  (x52)                        
SyskeyLen  :     0  (x00)     Incomplete :     .  (x00)                        
AuditRBA   :          8       AuditPos   : 19677200                            
Continued  :     N  (x00)     RecCount   :     1  (x01)                        
 
2012/08/31 07:35:43.060.853 Delete               Len   200 RBA 37501           
Name: ROGER.T                                                                  
Before Image:                                             Partition 4   G  b   
 0000 000a 0000 0006 5055 424c 4943 0001 0016 0000 | ........PUBLIC......      
 0012 4756 2444 425f 4341 4348 455f 4144 5649 4345 | ..GV$DB_CACHE_ADVICE      
 0002 0004 ffff 0000 0003 0008 0000 0004 3230 3437 | ................2047      
 0004 0004 ffff 0000 0005 000b 0000 0007 5359 4e4f | ................SYNO      
 4e59 4d00 0600 1500 0032 3030 352d 3036 2d33 303a | NYM......2005-06-30:      
 3139 3a31 313a 3034 0007 0015 0000 3230 3035 2d30 | 19:11:04......2005-0      
 362d 3330 3a31 393a 3131 3a30 3400 0800 1700 0000 | 6-30:19:11:04.......      
Column     0 (x0000), Len    10 (x000a)                                        
 0000 0006 5055 424c 4943                          | ....PUBLIC                
Column     1 (x0001), Len    22 (x0016)                                        
 0000 0012 4756 2444 425f 4341 4348 455f 4144 5649 | ....GV$DB_CACHE_ADVI      
 4345                                              | CE                        
Column     2 (x0002), Len     4 (x0004)                                        
 ffff 0000                                         | ....                      
Column     3 (x0003), Len     8 (x0008)                                        
 0000 0004 3230 3437                               | ....2047                  
Column     4 (x0004), Len     4 (x0004)                                        
 ffff 0000                                         | ....                      
Column     5 (x0005), Len    11 (x000b)                                        
 0000 0007 5359 4e4f 4e59 4d                       | ....SYNONYM               
Column     6 (x0006), Len    21 (x0015)                                        
 0000 3230 3035 2d30 362d 3330 3a31 393a 3131 3a30 | ..2005-06-30:19:11:0      
 34                                                | 4                         
Column     7 (x0007), Len    21 (x0015)                                        
 0000 3230 3035 2d30 362d 3330 3a31 393a 3131 3a30 | ..2005-06-30:19:11:0      
 34                                                | 4                         
Column     8 (x0008), Len    23 (x0017)                                        
 0000 0013 3230 3035 2d30 362d 3330 3a31 393a 3131 | ....2005-06-30:19:11      
 3a30 34                                           | :04                       
Column     9 (x0009), Len     9 (x0009)                                        
 0000 0005 5641 4c49 44                            | ....VALID                 
Column    10 (x000a), Len     5 (x0005)                                        
 0000 0001 4e                                      | ....N                     
Column    11 (x000b), Len     5 (x0005)                                        
 0000 0001 4e                                      | ....N                     
Column    12 (x000c), Len     5 (x0005)                                        
 0000 0001 4e                                      | ....N                     
 
 
Filtering suppressed    161 records                                            
Logdump 86 >n                                                                  
___________________________________________________________________            
Hdr-Ind    :     E  (x45)     Partition  :     .  (x04)                        
UndoFlag   :     .  (x00)     BeforeAfter:     B  (x42)                        
RecLength  :   197  (x00c5)   IO Time    : 2012/08/31 07:35:43.060.853         
IOType     :     3  (x03)     OrigNode   :   255  (xff)                        
TransInd   :     .  (x01)     FormatType :     R  (x52)                        
SyskeyLen  :     0  (x00)     Incomplete :     .  (x00)                        
AuditRBA   :          8       AuditPos   : 19677888                            
Continued  :     N  (x00)     RecCount   :     1  (x01)                        
 
2012/08/31 07:35:43.060.853 Delete               Len   197 RBA 37810           
Name: ROGER.T                                                                  
Before Image:                                             Partition 4   G  m   
 0000 0007 0000 0003 5359 5300 0100 1900 0000 1547 | ........SYS........G      
 565f 2453 4741 5f54 4152 4745 545f 4144 5649 4345 | V_$SGA_TARGET_ADVICE      
 0002 0004 ffff 0000 0003 0008 0000 0004 3230 3438 | ................2048      
 0004 0004 ffff 0000 0005 0008 0000 0004 5649 4557 | ................VIEW      
 0006 0015 0000 3230 3035 2d30 362d 3330 3a31 393a | ......2005-06-30:19:      
 3131 3a30 3400 0700 1500 0032 3030 352d 3036 2d33 | 11:04......2005-06-3      
 303a 3139 3a31 313a 3034 0008 0017 0000 0013 3230 | 0:19:11:04........20      
Column     0 (x0000), Len     7 (x0007)                                        
 0000 0003 5359 53                                 | ....SYS                   
Column     1 (x0001), Len    25 (x0019)                                        
 0000 0015 4756 5f24 5347 415f 5441 5247 4554 5f41 | ....GV_$SGA_TARGET_A      
 4456 4943 45                                      | DVICE                     
Column     2 (x0002), Len     4 (x0004)                                        
 ffff 0000                                         | ....                      
Column     3 (x0003), Len     8 (x0008)                                        
 0000 0004 3230 3438                               | ....2048                  
Column     4 (x0004), Len     4 (x0004)                                        
 ffff 0000                                         | ....                      
Column     5 (x0005), Len     8 (x0008)                                        
 0000 0004 5649 4557                               | ....VIEW                  
Column     6 (x0006), Len    21 (x0015)                                        
 0000 3230 3035 2d30 362d 3330 3a31 393a 3131 3a30 | ..2005-06-30:19:11:0      
 34                                                | 4                         
Column     7 (x0007), Len    21 (x0015)                                        
 0000 3230 3035 2d30 362d 3330 3a31 393a 3131 3a30 | ..2005-06-30:19:11:0      
 34                                                | 4                         
Column     8 (x0008), Len    23 (x0017)                                        
 0000 0013 3230 3035 2d30 362d 3330 3a31 393a 3131 | ....2005-06-30:19:11      
 3a30 34                                           | :04                       
Column     9 (x0009), Len     9 (x0009)                                        
 0000 0005 5641 4c49 44                            | ....VALID                 
Column    10 (x000a), Len     5 (x0005)                                        
 0000 0001 4e                                      | ....N                     
Column    11 (x000b), Len     5 (x0005)                                        
 0000 0001 4e                                      | ....N                     
Column    12 (x000c), Len     5 (x0005)                                        
 0000 0001 4e                                      | ....N                     
 
Logdump 87 >                      
Logdump 87 >n                                                                                                               
___________________________________________________________________            
Hdr-Ind    :     E  (x45)     Partition  :     .  (x04)                        
UndoFlag   :     .  (x00)     BeforeAfter:     B  (x42)                        
RecLength  :   202  (x00ca)   IO Time    : 2012/08/31 07:35:43.060.853         
IOType     :     3  (x03)     OrigNode   :   255  (xff)                        
TransInd   :     .  (x01)     FormatType :     R  (x52)                        
SyskeyLen  :     0  (x00)     Incomplete :     .  (x00)                        
AuditRBA   :          8       AuditPos   : 19678284                            
Continued  :     N  (x00)     RecCount   :     1  (x01)                        
 
2012/08/31 07:35:43.060.853 Delete               Len   202 RBA 38093           
Name: ROGER.T                                                                  
Before Image:                                             Partition 4   G  m   
 0000 000a 0000 0006 5055 424c 4943 0001 0018 0000 | ........PUBLIC......      
 0014 4756 2453 4741 5f54 4152 4745 545f 4144 5649 | ..GV$SGA_TARGET_ADVI      
 4345 0002 0004 ffff 0000 0003 0008 0000 0004 3230 | CE................20      
 3439 0004 0004 ffff 0000 0005 000b 0000 0007 5359 | 49................SY      
 4e4f 4e59 4d00 0600 1500 0032 3030 352d 3036 2d33 | NONYM......2005-06-3      
 303a 3139 3a31 313a 3034 0007 0015 0000 3230 3035 | 0:19:11:04......2005      
 2d30 362d 3330 3a31 393a 3131 3a30 3400 0800 1700 | -06-30:19:11:04.....      
Column     0 (x0000), Len    10 (x000a)                                        
 0000 0006 5055 424c 4943                          | ....PUBLIC                
Column     1 (x0001), Len    24 (x0018)                                        
 0000 0014 4756 2453 4741 5f54 4152 4745 545f 4144 | ....GV$SGA_TARGET_AD      
 5649 4345                                         | VICE                      
Column     2 (x0002), Len     4 (x0004)                                        
 ffff 0000                                         | ....                      
Column     3 (x0003), Len     8 (x0008)                                        
 0000 0004 3230 3439                               | ....2049                  
Column     4 (x0004), Len     4 (x0004)                                        
 ffff 0000                                         | ....                      
Column     5 (x0005), Len    11 (x000b)                                        
 0000 0007 5359 4e4f 4e59 4d                       | ....SYNONYM               
Column     6 (x0006), Len    21 (x0015)                                        
 0000 3230 3035 2d30 362d 3330 3a31 393a 3131 3a30 | ..2005-06-30:19:11:0      
 34                                                | 4                         
Column     7 (x0007), Len    21 (x0015)                                        
 0000 3230 3035 2d30 362d 3330 3a31 393a 3131 3a30 | ..2005-06-30:19:11:0      
 34                                                | 4                         
Column     8 (x0008), Len    23 (x0017)                                        
 0000 0013 3230 3035 2d30 362d 3330 3a31 393a 3131 | ....2005-06-30:19:11      
 3a30 34                                           | :04                       
Column     9 (x0009), Len     9 (x0009)                                        
 0000 0005 5641 4c49 44                            | ....VALID                 
Column    10 (x000a), Len     5 (x0005)                                        
 0000 0001 4e                                      | ....N                     
Column    11 (x000b), Len     5 (x0005)                                        
 0000 0001 4e                                      | ....N                     
Column    12 (x000c), Len     5 (x0005)                                        
 0000 0001 4e                                      | ....N                     
 
Logdump 88 >n                                                                  
___________________________________________________________________            
Hdr-Ind    :     E  (x45)     Partition  :     .  (x04)                        
UndoFlag   :     .  (x00)     BeforeAfter:     B  (x42)                        
RecLength  :   198  (x00c6)   IO Time    : 2012/08/31 07:35:43.060.853         
IOType     :     3  (x03)     OrigNode   :   255  (xff)                        
TransInd   :     .  (x01)     FormatType :     R  (x52)                        
SyskeyLen  :     0  (x00)     Incomplete :     .  (x00)                        
AuditRBA   :          8       AuditPos   : 19678668                            
Continued  :     N  (x00)     RecCount   :     1  (x01)                        
 
2012/08/31 07:35:43.060.853 Delete               Len   198 RBA 38381           
Name: ROGER.T                                                                  
Before Image:                                             Partition 4   G  m   
 0000 0007 0000 0003 5359 5300 0100 1a00 0000 1647 | ........SYS........G      
 565f 2453 4547 4d45 4e54 5f53 5441 5449 5354 4943 | V_$SEGMENT_STATISTIC      
 5300 0200 04ff ff00 0000 0300 0800 0000 0432 3035 | S................205      
 3000 0400 04ff ff00 0000 0500 0800 0000 0456 4945 | 0................VIE      
 5700 0600 1500 0032 3030 352d 3036 2d33 303a 3139 | W......2005-06-30:19      
 3a31 313a 3034 0007 0015 0000 3230 3035 2d30 362d | :11:04......2005-06-      
 3330 3a31 393a 3131 3a30 3400 0800 1700 0000 1332 | 30:19:11:04........2      
Column     0 (x0000), Len     7 (x0007)                                        
 0000 0003 5359 53                                 | ....SYS                   
Column     1 (x0001), Len    26 (x001a)                                        
 0000 0016 4756 5f24 5345 474d 454e 545f 5354 4154 | ....GV_$SEGMENT_STAT      
 4953 5449 4353                                    | ISTICS                    
Column     2 (x0002), Len     4 (x0004)                                        
 ffff 0000                                         | ....                      
Column     3 (x0003), Len     8 (x0008)                                        
 0000 0004 3230 3530                               | ....2050                  
Column     4 (x0004), Len     4 (x0004)                                        
 ffff 0000                                         | ....                      
Column     5 (x0005), Len     8 (x0008)                                        
 0000 0004 5649 4557                               | ....VIEW                  
Column     6 (x0006), Len    21 (x0015)                                        
 0000 3230 3035 2d30 362d 3330 3a31 393a 3131 3a30 | ..2005-06-30:19:11:0      
 34                                                | 4                         
Column     7 (x0007), Len    21 (x0015)                                        
 0000 3230 3035 2d30 362d 3330 3a31 393a 3131 3a30 | ..2005-06-30:19:11:0      
 34                                                | 4                         
Column     8 (x0008), Len    23 (x0017)                                        
 0000 0013 3230 3035 2d30 362d 3330 3a31 393a 3131 | ....2005-06-30:19:11      
 3a30 34                                           | :04                       
Column     9 (x0009), Len     9 (x0009)                                        
 0000 0005 5641 4c49 44                            | ....VALID                 
Column    10 (x000a), Len     5 (x0005)                                        
 0000 0001 4e                                      | ....N                     
Column    11 (x000b), Len     5 (x0005)                                        
 0000 0001 4e                                      | ....N                     
Column    12 (x000c), Len     5 (x0005)                                        
 0000 0001 4e                                      | ....N

由于ogg trail文件都是以事务为单位进行记录的,可以看到,上面的每次n操作的输出信息都是
一条记录,ogg这里确定一个事务是通过IO Time+AuditRBA来确认的,这是惟一的。

下面来完整的解析trail:

Logdump 10 >n
___________________________________________________________________ 
Hdr-Ind    :     E  (x45)     Partition  :     .  (x04)  
UndoFlag   :     .  (x00)     BeforeAfter:     A  (x41)  
RecLength  :    49  (x0031)   IO Time    : 2012/08/31 06:00:18.737.774   
IOType     :    15  (x0f)     OrigNode   :   255  (xff) 
TransInd   :     .  (x00)     FormatType :     R  (x52) 
SyskeyLen  :     0  (x00)     Incomplete :     .  (x00) 
AuditRBA   :          8       AuditPos   : 9637392 
Continued  :     N  (x00)     RecCount   :     1  (x01) 
 
2012/08/31 06:00:18.737.774 FieldComp            Len    49 RBA 1600 
Name: GGS.MPS 
After  Image:                                             Partition 4   G  b   
 0000 000a ffff 0000 0000 0000 0000 0007 001f 0000 | ....................  
 3230 3132 2d30 382d 3331 3a30 363a 3030 3a32 302e | 2012-08-31:06:00:20.  
 3832 3330 3030 3030 30                            | 823000000  
Column     0 (x0000), Len    10 (x000a)  
 ffff 0000 0000 0000 0000                          | ..........  
Column     7 (x0007), Len    31 (x001f)  
 0000 3230 3132 2d30 382d 3331 3a30 363a 3030 3a32 | ..2012-08-31:06:00:2  
 302e 3832 3330 3030 3030 30                       | 0.823000000

下面是关于上面输出信息header记录的完整解释:

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中iotype类型,有一个完整的操作列表,如下:

Logdump 72 >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
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 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、付费专栏及课程。

余额充值