logdump

转载自:http://www.killdb.com/2012/09/01/goldengate-学习系列4-logdump.html


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
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
oracle数据库同步、备份产品: ABOUT GOLDENGATE – COMPANY AND SOLUTIONS———— 5 TECHNOLOGY OVERVIEW————18 ARCHITECTURE ———— 22 CONFIGURING ORACLE GOLDENGATE ———— 28 STEP 1 PREPARE THE ENVIRONMENT————— 29 GOLDENGATE COMMAND INTERFACE————— 46 STEP 2 CHANGE CAPTURE 51 STEP 3 INITIAL LOAD———— 64 STEP 4 CHANGE DELIVERY 71 EXTRACT TRAILS AND FILES 76 GOLDENGATE DATA FORMAT 79 ALTERNATIVE FORMATS ———— 85 VIEWING IN LOGDUMP ———— 92 REVERSING THE TRAIL SEQUENCE ————— 104 PARAMETERS ———— 107 GLOBALS PARAMETERS 109 MANAGER PARAMETERS ———— 110 EXTRACT PARAMETERS———— 113 REPLICAT PARAMETERS ———— 122 DATA MAPPING AND TRANSFORMATION ———— 131 DATA SELECTION AND FILTERING————— 131 COLUMN MAPPING———— 138 FUNCTIONS———— 141 SQLEXEC ———— 149 MACROS———— 158 USER TOKENS———— 163 USER EXITS ———— 170 ORACLE SEQUENCES ———— 177 CONFIGURATION OPTIONS 178 BATCHSQL———— 179 COMPRESSION ———— 182 ENCRYPTION ———— 183 EVENT ACTIONS ———— 187 BIDIRECTIONAL CONSIDERATIONS ————— 192 ORACLE DDL REPLICATION 202 MANAGING ORACLE GOLDENGATE ———— 211 COMMAND LEVEL SECURITY 211 TRAIL MANAGEMENT———— 214 PROCESS STARTUP AND TCP/IP ERRORS ———— 219 REPORTING AND STATISTICS 221 MONITIORING ORACLE GOLDENGATE ———— 229 TROUBLESHOOTING———— 235 TECHNICAL SUPPORT ———— 244
 第1章 goldengate概述   1.1 goldengate的历史   1.2 goldengate家族   1.3 goldengate及oracle产品战略   1.4 goldengate支持的平台以及数据库   1.5 goldengate的定位   1.6 goldengate技术架构   1.7 goldengate的复制模式   1.8 各种应用模式展示   1.9 goldengate拓扑结构   1.10 goldengate 10g/11g新特性   1.11 goldengate的优势   1.12 goldengate应用情况  第2章 windows平台oracle-oracle的单向复制   2.1 目标概述   2.2 goldengate在windows平台的安装   2.3 配置goldengate进程组   2.4 验证dml复制结果     第3章 linux平台oracle rac-oracle standalone复制   3.1 目标概述   3.2 goldengate在linux平台的安装   3.3 配置源端进程组   3.4 配置目标端进程   3.5 dml测试 第2篇 基础篇  第4章 目标端数据初始化   4.1 目标端数据库初始化同步的方法及比较   4.2 数据库自带工具初始化   4.3 oracle的rman在线初始化   4.4 goldengate initial load直接传输初始化   4.5 goldengate initial load使用文件传输初始化  第5章 为oracle数据库配置ddl同步   5.1 不支持及有限支持的ddl类型   5.2 ddl处理方法   5.3 ddl复制的配置  第6章 ibm aix平台sybase-oracle数据库复制   6.1 目标概述   6.2 goldengate for sybase在aix 5.3上的安装注意事项   6.3 使用defgen生成数据表定义文件   6.4 配置源端进程   6.5 配置目标端进程  第7章 实际应用中常见场景及案例分析   7.1 目标概述   7.2 一对多复制   7.3 多对一复制   7.4 级联复制   7.5 数据的转换   7.6 双业务中心场景  第8章 goldengate日常维护   8.1 长事务处理   8.2 源端和目标端增减复制表   8.3 数据表重新同步   8.4 给数据库打补丁   8.5 给goldengate程序打补丁 第3篇 提高篇  第9章 goldengate错误分析与处理   9.1 goldengate常见异常处理   9.2 使用reperror进行错误处理   9.3 ddlerror处理ddl复制错误   9.4 discardfile记录进程错误信息   9.5 goldengate常见错误分析   9.6 中文表/中文字段处理   9.7 logdump分析工具  第10章 goldengate的安全特性   10.1 加密trail文件   10.2 加密数据库密码   10.3 网络传输加密   10.4 使用cmdsec进行权限控制  第11章 对goldengate的监控   11.1 使用ggsci命令监控   11.2 ggserr.log日志监控   11.3 日常运维监控的自动化脚本   11.4 使用goldengate director监控   11.5 web监控界面  第12章 使用goldengate veridata进行数据校验   12.1 goldengate veridata概述   12.2 安装goldengate veridata   12.3 配置goldengate veridata的安全属性   12.4 运行goldengate veridata程序进行数据比较  第13章 goldengate性能调整与优化   13.1 目标概述   13.2 extract进程优化   13.3 pump进程组的优化   13.4 replicat进程组的优化 第4篇 资料篇  第14章 goldengate实施的相关准备工作   14.1 前期准备的注意事项   14.2 生产库的信息收集   14.3 rman初始化方案  第15章 goldengate认证操作系统及数据库矩阵

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值