Viewing an Oracle GoldenGate Logdump Record

In our first installment of this series on Oracle GoldenGate Logdump,

Oracle GoldenGate Logdump – An Introduction

I introduced you the Oracle GoldenGate Logdump utility.

As we continue our overview of Oracle GoldenGate Logdump, we will look at viewing an Oracle GoldenGate Logdump record.

  For tools to help manage GoldenGate performance, click here

As a review from the last blog entry you will start by invoking Oracle GoldenGate Logdump and setting a few standard parameters as shown here:

From the GoldenGate home directory run the following command to invoke the logdump command.

[oracle@ora-oem gghome_1]$ ./logdump

Oracle GoldenGate Log File Dump Utility for Oracle

Version 12.3.0.1.2 OGGCORE_12.3.0.1.0_PLATFORMS_171208.0005

Copyright (C) 1995, 2017, Oracle and/or its affiliates. All rights reserved.

Logdump 1 >detail on

Logdump 2 >detail data

Logdump 3 >ghdr on

Logdump 4 >ggstoken detail

Logdump 5 >usertoken detail

You will always want to turn on detail, detail data, header information (ghdr) and user and ggs token as shown above.  Once you have configured what you want to see, open a trail file by using the open command:

Logdump 6 >open dirdat/lb000000004

Current LogTrail is /u02/app/oracle/product/12.3.0.1/gghome_1/dirdat/lb000000004

Now it’s just a matter of browsing records.  This is done by typing n (next).  The first record that you will see is the file header.

Logdump 57 >n

2018/01/15 09:56:31.595.258 FileHeader           Len  1431 RBA 0

Name: *FileHeader*

3000 0322 3000 0008 4747 0d0a 544c 0a0d 3100 0002 | 0..”0…GG..TL..1…

0006 3200 0004 2000 0000 3300 0008 02f2 8906 1d24 | ..2… …3……..$

cefa 3400 004c 004a 7572 693a 6f72 612d 6f65 6d3a | ..4..L.Juri:ora-oem:

7065 7266 7475 6e69 6e67 3a63 6f6d 3a3a 7530 323a | perftuning:com::u02:

6170 703a 6f72 6163 6c65 3a70 726f 6475 6374 3a31 | app:oracle:product:1

322e 332e 302e 313a 6767 686f 6d65 5f31 3a45 5854 | 2.3.0.1:gghome_1:EXT

3032 3600 0014 0012 6469 7264 6174 2f6c 6230 3030 | 026…..dirdat/lb000

The next records will include some additional configuration information followed by a table definition.  Since GoldenGate 12, self-describing trail files have taken the place of defgen.  The first time a table is used in a trail file, the table definition is included.  Here is an example of the SOE.LOGON table.

Logdump 60 >n

___________________________________________________________________

Hdr-Ind    :     E  (x45)     Partition  :     .  (x00)

UndoFlag   :     .  (x00)     BeforeAfter:     A  (x41)

RecLength  :   321  (x0141)   IO Time    : 2018/01/15 09:56:36.340.414

IOType     :   170  (xaa)     OrigNode   :     2  (x02)

TransInd   :     .  (x03)     FormatType :     R  (x52)

SyskeyLen  :     0  (x00)     Incomplete :     .  (x00)

DDR/TDR Idx:   (001, 001)     AuditPos   : 11630684

Continued  :     N  (x00)     RecCount   :     1  (x01)

2018/01/15 09:56:36.340.414 Metadata             Len 321 RBA 1629

Name: SOE.LOGON

*

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: 11

Definition for table SOE.LOGON

Record Length: 134

Columns: 3

LOGON_ID      64     50        0  0  0 1 0     50     50     50 0 0 0 0 1    0 1   2    2       -1      0 0 0

CUSTOMER_ID   64     50       56  0  0 1 0     50     50     50 0 0 0 0 1    0 1   2    2       -1      0 0 0

LOGON_DATE   192     19      112  0  0 1 0     19     19     19 0 5 0 0 1    0 1   0   12       -1      0 0 0

End of definition

This eliminates the need for table definitions to be created using defgen.  If you’ve ever had to use it, you really appreciate this feature.

Finally, we start seeing some actual records in the trail file.  Each record includes a header, record data and GGS tokens.

Logdump 61 >n

___________________________________________________________________

Hdr-Ind    :     E  (x45)     Partition  :     .  (x0c)

UndoFlag   :     .  (x00)     BeforeAfter:     A  (x41)

RecLength  :    54  (x0036)   IO Time    : 2018/01/15 09:56:32.000.000

IOType     :     5  (x05)     OrigNode   :   255  (xff)

TransInd   :     .  (x03)     FormatType :     R  (x52)

SyskeyLen  :     0  (x00)     Incomplete :     .  (x00)

AuditRBA   :       1276       AuditPos   : 11630684

Continued  :     N  (x00)     RecCount   :     1  (x01)

2018/01/15 09:56:32.000.000 Insert               Len    54 RBA 2010

Name: SOE.LOGON  (TDR Index: 1)

After  Image:                                       Partition 12   G  s

0000 0b00 0000 0700 3236 3035 3236 3201 000a 0000 | ……..2605262…..

0006 0038 3135 3933 3502 0015 0000 0032 3031 382d | …815935……2018-

3031 2d31 353a 3039 3a35 363a 3332                | 01-15:09:56:32

Column     0 (x0000), Len    11 (x000b)

0000 0700 3236 3035 3236 32                       | ….2605262

Column     1 (x0001), Len    10 (x000a)

0000 0600 3831 3539 3335                          | ….815935

Column     2 (x0002), Len    21 (x0015)

0000 3230 3138 2d30 312d 3135 3a30 393a 3536 3a33 | ..2018-01-15:09:56:3

32                                                | 2

GGS tokens:

TokenID x52 ‘R’ ORAROWID         Info x00  Length   20

4141 4157 6a56 4141 4141 4141 757a 6c41 4542 0001 | AAAWjVAAAAAAuzlAEB..

TokenID x74 ‘t’ ORATAG           Info x01  Length    0

TokenID x4c ‘L’ LOGCSN           Info x00  Length    8

3134 3531 3437 3534                               | 14514754

TokenID x36 ‘6’ TRANID           Info x00  Length   12

302e 332e 3138 2e31 3031 3731                     | 0.3.18.10171

TokenID x69 ‘i’ ORATHREADID      Info x01  Length    2

0001                                              | ..

Let’s break down the header:

___________________________________________________________________

Hdr-Ind    :     E  (x45)     Partition  :     .  (x0c)

UndoFlag   :     .  (x00)     BeforeAfter:     A  (x41)

RecLength  :    54  (x0036)   IO Time    : 2018/01/15 09:56:32.000.000

IOType     :     5  (x05)     OrigNode   :   255  (xff)

TransInd   :     .  (x03)     FormatType :     R  (x52)

SyskeyLen  :     0  (x00)     Incomplete :     .  (x00)

AuditRBA   :       1276       AuditPos   : 11630684

Continued  :     N  (x00)     RecCount   :     1  (x01)

Included in the header are some interesting pieces of information.

TransInd:  This tells transactional information.  x00 = beginning of transaction, x01 = record in a transaction, x02 = last record of a transaction, x03 = only record in a transaction.

AuditRBA:  For Oracle this is the current redo log.

AuditPos:  For Oracle this is the position in the redo log file.

The next information describes the record.  It gives the timestamp, type type of operation, the record length and the RBA (Relative Byte Address) or position in the trail file.  Also is the table name and type of record; a before or after image.

2018/01/15 09:56:32.000.000 Insert               Len    54 RBA 2010

Name: SOE.LOGON  (TDR Index: 1)

After  Image:                                    Partition 12   G  s

This is followed by the actual data being inserted (in Hex).

0000 0b00 0000 0700 3236 3035 3236 3201 000a 0000 | ……..2605262…..

0006 0038 3135 3933 3502 0015 0000 0032 3031 382d | …815935……2018-

3031 2d31 353a 3039 3a35 363a 3332                | 01-15:09:56:32

Column     0 (x0000), Len    11 (x000b)

0000 0700 3236 3035 3236 32                       | ….2605262

Column     1 (x0001), Len    10 (x000a)

0000 0600 3831 3539 3335                          | ….815935

Column     2 (x0002), Len    21 (x0015)

0000 3230 3138 2d30 312d 3135 3a30 393a 3536 3a33 | ..2018-01-15:09:56:3

32                                                | 2

Finally, you can see the GGSToken (if selected).

GGS tokens:

TokenID x52 ‘R’ ORAROWID         Info x00  Length   20

4141 4157 6a56 4141 4141 4141 757a 6c41 4542 0001 | AAAWjVAAAAAAuzlAEB..

TokenID x74 ‘t’ ORATAG           Info x01  Length    0

TokenID x4c ‘L’ LOGCSN           Info x00  Length    8

3134 3531 3437 3534                               | 14514754

TokenID x36 ‘6’ TRANID           Info x00  Length   12

302e 332e 3138 2e31 3031 3731                     | 0.3.18.10171

TokenID x69 ‘i’ ORATHREADID      Info x01  Length    2

0001

You will be able to find the SCN number of the transaction in the GGSToken.  The LOGSCN is shown in the GGSToken of the first record in the transaction.  i.e. TransInd x00.

In the next installment,

How to Traverse a Trail File in Logdump

We will cover how to traverse the trail file using Oracle GoldenGate Logdump.

By | 2018-07-03T12:50:14+00:00 June 28th, 2018|Uncategorized|Comments Off on Viewing an Oracle GoldenGate Logdump Record