ORACLE/ADMIN

Logdump Utility

argoLee 2019. 11. 13. 14:01

Logdump Utility

Oracle GoldenGate Software includes the Logdump Utility for viewing data directly from the trail files.

 

Without the Logdump, it is not possible to read the content of the Oracle GoldenGate trail files, as the trail files are in a binary format. With Logdump, we can open up the trail file, read its content, navigate through the file, view transactions at different RBA’s (relative byte address – file position), help identify the type of commands (DML or DDL) issued on the source, including delete, insert, update, alter and create statements.

 

Hence Logdump Utility is most important utility in troubleshooting GoldenGate Issues.

 

To invoke the utility, go to the GoldenGate home directory and type “logdump”, as shown in the following example.

 

[oracle@dbserver1 ggs]$ ./logdump

 

LogDump Commands:

 

1. How to open LogDump: Navigate to the directory where the Oracle GoldenGate Software is installed and execute the Logdump.

 

[GoldenGate]$ $GG_HOME/logdump

 

2. Opening a Trail File:  To open a trail file and read its content, specify the trail file at the logdump prompt. Trail files are usually found in the GoldenGate dirdat directory.

 

$ ls -lrt

 

$GG_HOME/dirdat

 

$-rw-rw-rw- 1 oracle oinstall 78325 May 7 10:38 EE000001

$-rw-rw-rw- 1 oracle oinstall 78325 May 7 10:42 EE000002

$-rw-rw-rw- 1 oracle oinstall 78325 May 7 10:55 EE000003

 

You can also determine the current trail file directory/name by running the “INFO process_name” command at the ggsci prompt.

 

3. Open and view the details of local trail file: 

Logdump> OPEN ./dirdat/EE000001

Change the file name and location as required.

 

4. Set Output Format: Enable the following options so that you are able to view the results in a readable format in your Logdump session.

a) Set trail file header details on: The FILEHEADER contains the header details of the currently opened trail file.

Logdump> FILEHEADER DETAIL

b) Record Header: 

Logdump> GHDR ON

c) Set Column Details on: It displays the list of columns, their ID, length, Hex values etc.

Logdump> DETAIL ON

d) User Token Details: User token is the user-defined information stored in a trail, associated with the table mapping statements. The CSN (SCN in Oracle Database) associated with the transaction is available in this section.

Logdump> USERTOKEN DETAIL

e) Set length of the record to be displayed: In this case, it is 128 characters.

Logdump> RECLEN 128

 

5. Viewing the records: To view particular records in the trail files, navigate as below in the local trail file.

a) First record in the trail file: Here “0” is the beginning of the trail file

Logdump> POS 0

b) Move to a specific record, at a particular RBA
The “xxxx” is the RBA number.

Logdump> POS xxxx

c) Next record in the opened trail file
Logdump> N
Or
Logdump> NEXT

d) Moving forward or reverse in the trail file
Logdump> POS FORWARD
or
Logdump> POS REVERSE

e) Skip certain number of records
Here ‘x’ is the number of records you want to skip.

Logdump> SKIP x

f) Last record in the trail file
Logdump> POS last

 

6. Filter Commands:

We can use filter commands to view the specific operations or data records, a record at a specific RBA, the record length, record type, etc. using the commands below.

 

To start filtration, use the “filter” keyword, followed by include or exclude. These options allow the data to be removed or shown, based on the filter criteria. Then apply other conditions like file name, rectype, iotype etc. Here rectype is record type and iotype is input output type.

 

There are number of operation we can filter using the Logdump. To view the list of operation types and the number assigned to them, run below command.

a) Show the Record Types 

Logdump> SHOW RECTYPE

b) Enable or disable filteration:

Logdump> FILTER [ ENABLE | DISABLE ]

Filter Records by Table Name

Logdump> FILTER INCLUDE FILENAME CC_APP.IMAGE_DETAIL

c) Filter Records by Operation Type: Operation types are Insert, Update, and Delete.

Logdump> FILTER INCLUDE IOTYPE INSERT

d) Filter Records using the operation number
You can specify the IOTYPE by using the equivalent operation number.

Logdump 374> FILTER INCLUDE IOTYPE 160
Logdump 374> N
n
Sample Output:

 

2013/02/18 00:36:05.000.000 DDLOP Len 1169 RBA 3049

Name:

After Image: Partition 0 G s

2c43 353d 2733 3135 3435 272c 2c42 373d 2733 3135 | ,C5=’31545′,,B7=’315

3735 272c 2c42 323d 2727 2c2c 4233 3d27 5331 272c | 75′,,B2=”,,B3=’S1′,

2c42 343d 2754 4553 545f 3132 272c 2c43 3132 3d27 | ,B4=’TEST’,,C12=’

272c 2c43 3133 3d27 272c 2c42 353d 2754 4142 4c45 | ‘,,C13=”,,B5=’TABLE

272c 2c42 363d 2743 5245 4154 4527 2c2c 4238 3d27 | ‘,,B6=’CREATE’,,B8=’

4747 5553 4552 2e47 4753 5f44 444c 5f48 4953 5427 | GGUSER.GGS_DDL_HIST’

2c2c 4239 3d27 5331 272c 2c43 373d 2731 312e 322e | ,,B9=’S1′,,C7=’11.2.

Filtering suppressed 2 records

 

Note: Here 160 represent DDL operation and in the detail, we can see the DDL type like below is “CREATE” and suppressed means number of records skipped to reach next filter value.

e) View currently applied filters

Logdump> FILTER SHOW

Sample output:
Data filters are ENABLED

Include Match ANY
Rectypes: DDLOP

Exclude Match ANY

f) Filter on multiple conditions:
We can filter the data of trail file using the multiple conditions together.

For that we can string multiple FILTER commands together, separating each one with a semicolon, as shown in the below example:

Logdump>FILTER INCLUDE FILENAME [SCHEMA].[TABLE]; FILTER RECTYPE 5; FILTER INCLUDE IOTYPE INSERT
The above example will display only “5”,” insert” statement records from the specified table.

Note: [SCHEMA] & [TABLE] is the name of the schema and table, and should be in upper case.

g) Clear the filter in the session
Logdump> FILTER CLEAR

 


Sample output:

[oracle@ggnode ~]$ cd /u01/gg12c/
[oracle@ggnode gg12c]$ ls -ltr |grep log
-rwxr-x--- 1 oracle oinstall 30538126 Jul 14 2017 logdump
-rwxr-x--- 1 oracle oinstall 14312189 Jul 14 2017 libgglog.so
-rw-r----- 1 oracle oinstall 3168 Jul 26 2017 gglog-RNSIMEX1.dmp
-rw-r----- 1 oracle oinstall 0 Jul 27 2017 gglog-ggsci.dmp
drwxr-xr-x 5 oracle oinstall 20480 Aug 7 2017 cfgtoollogs
-rw-r--r-- 1 oracle oinstall 480 Aug 11 2017 gglog-ENSIMEX1.xml.txt
-rw-r----- 1 oracle oinstall 2097151957 Sep 7 2017 gglog-ENSIMEX1.log.2
-rw-r----- 1 oracle oinstall 200881340 Sep 7 2017 gglog-ENSIMEX1.log.1
-rw-r----- 1 oracle oinstall 8577489 Sep 7 2017 gglog-ENSIMEX1.log
-rw-r----- 1 oracle oinstall 19249553 May 7 08:31 ggserr.log
[oracle@ggnode gg12c]$ ./logdump open /u01/gg12c/dirdat/nsim1/r1000000021

Oracle GoldenGate Log File Dump Utility for Oracle
Version 12.2.0.1.170221 23712604

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

Current LogTrail is /u01/gg12c/dirdat/nsim1/r1000000021
Logdump 37 >log support1.lst
--- Session log support1.lst opened 2018/05/07 08:53:08.098.874 ---
Logdump 38 >ghdr on
Logdump 39 >detail data on
Logdump 40 >
Logdump 40 >usertoken detail
Logdump 41 >
Logdump 41 >headertoken detail
Logdump 42 >fileheader detail
Logdump 43 >ggstoken detail
Logdump 44 >pos 0
Reading forward from RBA 0
Logdump 45 >pos 3849
Bad record found at (RBA 3849, format 5.50 Unknown TokenID 6d)
 4602 05a0 3000 0342 3000 0008 4747 0d0a 544c 0a0d | F...0..B0...GG..TL..
 3100 0002 0005 3200 0004 2000 0000 3300 0008 02f2 | 1.....2... ...3.....
 9180 19d7 9dbc 3400 0029 0027 7572 693a 4256 4f52 | ......4..).'uri:BVOR
 414c 3031 3a3a 6f72 6163 6c65 5f64 6174 613a 6767 | AL01::oracle_data:gg
 7377 3a50 4e53 494d 4c42 3135 0000 2d35 0000 2900 | sw:PNSIMLB15..-5..).
 2775 7269 3a42 564f 5241 4c30 313a 3a6f 7261 636c | 'uri:BVORAL01::oracl
 655f 6461 7461 3a67 6773 773a 454e 5349 4d4c 4231 | e_data:ggsw:ENSIMLB1
 3600 0026 0024 2f67 6773 772f 6767 3132 632f 6469 | 6..&.$/u01/gg12c/di
 7264 6174 2f6e 7369 6d31 2f72 3130 3030 3030 3030 | rdat/nsim1/r10000000
 3231 3700 0001 0138 0000 0400 0000 1539 ff00 0800 | 217....8.......9....
 0000 0000 0000 003a 0000 8109 3131 3036 3931 3233 | .......:....11069123
 3400 0000 0000 0000 0000 0000 0000 0000 0000 0000 | 4...................
 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 | ....................
.
. . . . . . . . . . 
. Long Text skipped 
. . . . . . . . . . 
.
.
 2d31 3404 000a 0000 0000 0001 6325 9046 7605 000a | -14.........c%.Fv...
 0000 0000 0001 632a b6a2 7606 004b 0000 0047 002f | ......c*..v..K...G./
 7365 7276 6963 652f 7469 6d65 7243 616c 6c62 6163 | service/timerCallbac
 6b2f 7072 696d 6172 7944 6576 6963 6543 6865 636b | k/primaryDeviceCheck
 456e 7450 6572 696f 6446 6f72 4f70 7469 6d69 7a65 | EntPeriodForOptimize
 6448 6561 7274 6265 6174 0700 1e00 0000 1a00 7b22 | dHeartbeat........{"
 696d 7369 22 | imsi"
Reading forward from RBA 3849
Logdump 46 >n
TokenID x47 'G' Record Header Info x01 Length 483
TokenID x48 'H' GHDR Info x00 Length 36
 450c 0041 6201 05ff 2b44 2e1f 7a91 f202 bc0e d202 | E..Ab...+D..z.......
 0000 0000 1c08 0000 0352 0000 0001 0100 | .........R......
TokenID x44 'D' Data Info x00 Length 354
TokenID x54 'T' GGS Tokens Info x00 Length 73
TokenID x5a 'Z' Record Trailer Info x01 Length 483

...

GGS tokens:
TokenID x52 'R' ORAROWID Info x00 Length 20
 4141 4163 477a 4141 4141 414e 4141 7541 4143 0001 | AAAcGzAAAAANAAuAAC..
TokenID x74 't' ORATAG Info x01 Length 0
TokenID x4c 'L' LOGCSN Info x00 Length 9
 3131 3036 3931 3233 34 | 110691234
TokenID x36 '6' TRANID Info x00 Length 22
 3337 3831 3238 3036 3332 2e32 302e 322e 3131 3932 | 3781280632.20.2.1192
 3935 | 95
TokenID x69 'i' ORATHREADID Info x01 Length 2
 0001 | ..

Logdump 47 >exit

 

 

 

 

 

Reference: 

 

1 Using the Logdump Utility

This chapter contains instructions for using the Logdump utility of Oracle GoldenGate. Logdump enables you to search for, filter, view, and save data that is stored in a trail or extract file. 1.1 Getting Started with Logdump This section introduces you to

docs.oracle.com

 

Oracle GoldenGate

Oracle GoldenGate Oracle GoldenGate is a comprehensive software package for real-time data integration and replication in heterogeneous IT environments. The product set enables high availability solutions, real-time data integration, transactional change d

www.oracle.com