ogg logdump详解

来源:互联网 发布:陈子豪cf手游刷枪软件 编辑:程序博客网 时间:2024/06/08 15:50
1.查看record header:
To view the record header with the data:
Logdump 1> GHDR ON
The record header contains information about the transaction.


2.添加列信息,列信息包括使用hex和ascii的编码显示的长度:
To add column information:
Logdump 2> DETAIL ON
Column information includes the number and length in hex and ASCII.


3.添加列的值,以hex和ascii显示:
To add hex and ASCII data values to the column information:
Logdump 3> DETAIL DATA


4.查看user tokens:
To view user tokens:
Logdump 4> USERTOKEN ON
User tokens are custom user-defined information that is specified in a TABLEor
FILEmapping statement and stored in the trail file for specific purposes.


5.查看gg自动的tokens:
To view automatically generated tokens:
Logdump 4> GGSTOKEN ON
Oracle GoldenGate automatically generated tokes include the transaction ID (XID),
the row id for DML operations, the fetchingstatus (if applicable), and tag value.


6.控制一次显示多少条记录:
To control how much record data is displayed:
Logdump 5> RECLEN length


7.打开一个trail文件
Open a file with the following command:
Logdump 6> OPEN file_name
Where:
file_nameis either the relative name or fully qualified name of the file, including
the file sequence number. For example:
open /home/ggs/dirdat/jd000000
open $data01.glogggl.aa000000


8.显示下一个记录
To go to the first record and then move through records in sequence:

Logdump 7> NEXT


9.搜索下一个记录的头部信息
To find the next good record header, enter the following command:
Logdump 8> SCANFORHEADER



通过TransInd可以知道这个sql是在事务中的哪个位置,x00是第一条sql,x01是中间的sql,x02是最后一条sql,如果是x03表示这个事务里面只有一条sql:
Transaction Indicator Description
TransInd : . (x00) First statement in transaction
TransInd : . (x01) Statement in middle of transaction
TransInd : . (x02) Last statement in transaction
TransInd : . (x03) Sole statement in transaction
如果TransInd是x02或者x03,那么下一个记录的TransInd必然是x00,是一个新的事务的开始:
When TransInd is eitherx02
or x03, the TransIndof the next record should be x00, starting a new transaction
或者使用SFET,查找事务的结尾:
To scan for the end of a transaction, enter the following command:
Logdump 20> SCANFORENDTRANS


10.跳转到指定的rba:
■ To go to an RBA anywhere in the file:
Logdump 35> POS 9
Logdump 36> N
This displays the record located at that RBA.
跳转到第一个记录:
■ To go to the first record in the file:
Logdump 37> POS FIRST
Alternatively, you can enter the following command:
Logdump 37> POS 0


11.过滤掉你不想看的表,只看你想看的表
To filter out everything except records containing a specific table name:
On a Windows or UNIX system:
Logdump 60> FILTER INCLUDE FILENAME [container| catalog] schema.table
注意:这里你想看哪个表就写哪个表,其它表的信息将被过滤。经过测试schema.table必须要用大写
清除过滤信息
To remove the current filter criteria, enter the following command:
Logdump 62> FILTER CLEAR
多条件的过滤:
To filter on multiple conditions, enter one of the following commands:
■ Logdump 60> FILTER INCLUDE FILENAME $volume.subvolume...file..; FILTER
RECTYPE record_type; FILTER MATCH ALL
■ Logdump 60> FILTER INCLUDE ANSINAME catalog.schema.table; FILTER
RECTYPE record_type; FILTER MATCH ALL
■ Logdump 65> FILTER INCLUDE FILENAMEschema.table; FILTER RECTYPE
record_type; FILTER MATCH ALL


例如:Logdump 201 >filter include filename TEST2.TDATE;FILTER rectype insert;filter match allLogdump 202 >countLogTrail /ogg/oracle/dirdat/lt000012 has 1 recordsTotal Data Bytes                 25  Avg Bytes/Record               25Insert                            1After Images                      1Filtering matched            1 records          suppressed         8 recordsAverage of 1 Transactions    Bytes/Trans .....         73    Records/Trans ...          1    Files/Trans .....          1TEST2.TDATE                                        Partition 4Total Data Bytes                 25  Avg Bytes/Record               25Insert                            1After Images                      1

这个例子中只看TEST2.TDATE的insert操作,过滤了8条其它的操作!

这里也可以使用数字代表rectype,例如:Logdump 207 >filter include filename TEST2.TDATE;FILTER rectype 115;filter match all Logdump 105 >show RECTYPELogTrail 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                     135 - GGSUnifiedPKUpdate        134 - GGSUnifiedUpdate                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 filter_optioncan be one of:{ANSINAME name[, name] |AUDITRBA rba[comparison_operator] |CLEAR {filter_spec| ALL} |CSN | LogCSN [comparison_operator] [value]ENDTIME time_string|FILENAME name[, name] |GGSTOKEN token_name[comparison_operator] [token_value] |HEX "hex_string" [byte_range][, "hex_string" [byte_range]] [...] |INT16 16_bit_integer|INT32 32_bit_integer|IOTYPE operation_type[, operation_type] |MATCH {ANY | ALL} |OFF |ON |PROCESS process_name|RBA byte_address[comparison_operator] [...] |RECLEN length[comparison_operator] |RECTYPE {type_number| type_name} |SHOW |STARTTIME time_string|STRING [BOTH] [B],text[column_range][[B],text[column_range]] [...] |SYSKEY system_key[comparison_operator] [...] |TRANSID transaction_identifier|TRANSIND indicator[comparison_operator] |TYPE type|UNDOFLAG type[comparison_operator] |USERTOKEN token_name[comparison_operator] [token_value]}

12.显示汇总信息,包括表做了多是操作等等
The following command shows a count summary followed by counts for each table or
data file:
Logdump 67> COUNT

例1,统计时间间隔:COUNT START 2011-01-11 12:00:00 , END 2011-01-12 12:00:00例2,统计dirtdat目录下所有lt开头的trail文件信息Logdump 308 >count log lt*Current LogTrail is /ogg/oracle/dirdat/lt000010LogTrail /ogg/oracle/dirdat/lt000010 has 68 recordsLogTrail /ogg/oracle/dirdat/lt000010 closedCurrent LogTrail is /ogg/oracle/dirdat/lt000007LogTrail /ogg/oracle/dirdat/lt000007 has 4 recordsLogTrail /ogg/oracle/dirdat/lt000007 closedCurrent LogTrail is /ogg/oracle/dirdat/lt000008LogTrail /ogg/oracle/dirdat/lt000008 has 117 recordsLogTrail /ogg/oracle/dirdat/lt000008 closedCurrent LogTrail is /ogg/oracle/dirdat/lt000011LogTrail /ogg/oracle/dirdat/lt000011 has 1625 recordsLogTrail /ogg/oracle/dirdat/lt000011 closedCurrent LogTrail is /ogg/oracle/dirdat/lt000012LogTrail /ogg/oracle/dirdat/lt000012 has 9 recordsLogTrail /ogg/oracle/dirdat/lt000012 closedCurrent LogTrail is /ogg/oracle/dirdat/lt000009LogTrail /ogg/oracle/dirdat/lt000009 has 2 recordsLogTrail /ogg/oracle/dirdat/lt000009 closedLogTrail lt* has 1825 records例3、count detail 显示所有的操作,而不是统计。

13.save保存文件
save命令将当前的trail文件中的记录保存到其它文件中,一般trail文件比较大,不方便分析,
用save将部分的记录保存到其它文件中,并且可以用ogg继续分析这个文件,方便分析
Use SAVEto write a subset of the records to a new trail or extract file. By saving a
subset to a new file, you can work with a smaller file that is easier to debug. Saving to
another file also enables you to extract valid records that can be processed by Oracle
GoldenGate, while excluding records that may be causing errors.
To set the version of the trail or file (to old or new format), use the TRAILFORMAT command.
SAVE file_name[!] {nrecords | nbytes}
[NOCOMMENT]
[OLDFORMAT | NEWFORMAT]
[TRANSIND indicator]
[TRUNCATE]
To save the whole file, enter the following command, where fileis the name of the
new file:
Logdump 68> SAVE file
To save a subset of records, enter the following command:
Evaluating Transaction Size
Using the Logdump Utility 1-7
Logdump 69> SAVE file nRECORDS

Logdump 47 >save aaa 3 recordsSaved 3 records to /ogg/oracle/dirdat/aaaLogdump 48 >lsaaa  lr000012  lt000008  lt000009  lt000010  lt000011  lt000012Logdump 52 >open aaaCurrent LogTrail is /ogg/oracle/dirdat/aaaLogdump 53 >countLogTrail /ogg/oracle/dirdat/aaa has 4 recordsTotal Data Bytes               1401  Avg Bytes/Record              350Insert                            2RestartOK                         1Others                            1After Images                      3Average of 3 Transactions    Bytes/Trans .....        531    Records/Trans ...          1    Files/Trans .....          1

14.自动打开下一个trail文件
To close the current file and open the next one in the trail, enter the following
command:
Logdump 70> NEXTTRAIL


16.打开一个日志,记录你的操作,类似于spool
To start logging, enter the following command:
Logdump 71> LOG TO filename.txt
To write text to the log:
Logdump 72> WRITELOG "text"
To stop logging:
Logdump 73> LOG STOP


17.env显示logdump的环境变量,还会显示trail的一些信息:

To see the current Logdump environment, enter the following command:Logdump 228 >envVersion             : Linux, x64, 64bit (optimized) on Aug  7 2014 05:41:04Current Directory   : /ogg/oracleLogTrail            : /ogg/oracle/dirdat/lt000012Trail Format        : NewEnd of File         : 2311Current Position    : 1374    ForwardNext Position       : 1435Last Modtime        : 2015/09/13 09:12:55.000.000Display RecLen      : 16960Logtrail Filter     : OnShow Ghdr           : On Detail              : Data UserToken           : On Trans History       : 0 Transactions, Records 100, Bytes 100000LargeBlock I/O      : On, Blocksize 57344Local System        : LittleEndianMetadata Byte Order : BigEndian   Logtrail Data       : BigEndian/ASCIILogtrail Headers    : ASCIIDump                : ASCIISavefile comments   : OffTimeoffset          : LOCALScan Notify Interval: 10000 records, Scrolling On

18.设置trans大小,用来跟踪事务的大小
a. Use TRANSHISTto set the size of the history table that tracks transaction size. The
maximum size is 200 bytes. A value of 0 turns off the tracking
TRANSHIST n
--设置两个参数transreclimt和transbytelimit来设置阀值,当事务的大小或者记录数超过阀值的时候被跟踪,而且在count命令下会显示出来
b. Use either the TRANSRECLIMITor TRANSBYTELIMITcommand to set a lower
boundary for what is considered a normal sized transaction. These commands
prevent normal-sized transactions from being tracked. Eliminating normal-sized
transactions reduces the amount of data that must be reviewed.
{TRANSBYTELIMIT n bytes| TRANSRECLIMIT n records}


19.logdump的历史命令会写在下面几个目录中,一般是在$HOME下的logdump.hst
■ The USERPROFILEenvironment variable.
■ The $HOMEenvironment variable.
■ The default $vol.subvol19.begin设置一个时间,用来查找这个时间附近的记录
Use BEGINto do a binary search through a TMF orOracle GoldenGate trail to locate a
record at or near the specified time.
Logdump 284 >begin 2015/09/13 07:24:03


20.BULKIOSTATS用来显示物理和逻辑读和平均读取时间
Use BULKIOSTATSto display statistics for bulk I/O records, including the number of
physical and logical reads and current and average read times.


21.用COMPUTETIMESTAMP转换时间格式为julian格式
Use COMPUTETIMESTAMP to convert a datetime string to Julian format.
Logdump 290 >computetimestamp 2015-09-13 02:31:16
2015-09-13 02:31:16 is JulianTimestamp 212308871476000000


22.如果trail文件是加密的,使用decrypt命令进行解密
Use DECRYPTto decrypt data that was encrypted with Oracle GoldenGate trail
encryption, so that it can be viewed with Logdump.
Example
DECRYPT ON
Example
DECRYPT ON KEYNAME mykey


23.FLOAT命令将number转换成hex和float行number
Use FLOATto display a number or hex string inboth its hex representation and as a
floating-point number. This command is useful when looking for a specific
floating-point number and you need the hex representation of that number. This
command does not require a trail file to be opened
Logdump 21 >float 5
4014000000000000  5.000000


24.SCANFORHEADER/SFH寻找下一条记录的头部
25.SCANFORENDTRANS/SFET寻找下一条记录的尾部信息  
26.SCANFORRBA/SFR 寻找字节附件的记录             SCANFORRBA 321 /home/ggs/dirdat/rt000000
27.SCANFORTIME/SFTS寻找某个时间点的记录       SCANFORTIME 2011-01-27 14:33:57
28.SCANFORTYPE/SFT  寻找下一条指定类型的记录 SHOW RECTYPE查看操作类型 SCANFORTYPE Commit 、SFT 2
29.show显示logdump的内部信息:
Use SHOW to display internal Logdump information
SHOW
[ENV]
[FILTER]
[OPEN]
[RECTYPE]


30.skip跳过多少条记录
Use SKIPto skip the specified number of records.


31.obey  执行文件中的一系列命令

OBEY file_name


32.fc显示并执行上一条命令

fc

fc n






0 0
原创粉丝点击