1 Using the Logdump Utility
Important:
To avoid any adverse effects on the data or checkpoints in your trails, use Logdump only with guidance from an Oracle support analyst or an experienced Oracle GoldenGate user.
This chapter includes the following sections:
Getting Started with Logdump
This section introduces you to basic Logdump commands that enable you to open files, control the display, navigate through a file, and filter for specific information, among other basic tasks. It also illustrates and explains the components of a record.
Executing Basic Logdump Tasks
The following are some basic tasks that can be performed with Logdump. For detailed information about the commands shown and other available options, see the alphabetical reference in Logdump Commands.
Finding the Next Good Record Header
To find the next good record header, enter the following command:
Logdump 8> SCANFORHEADER
Alternatively, you can simply enter SFH
.
Finding the Beginning, Middle, and End of a Transaction
To find the beginning, middle, and end of a transaction, complete the following steps:
Scanning for the End of a Transaction
To scan for the end of a transaction, enter the following command:
Logdump 20> SCANFORENDTRANS
Alternatively, you can simply enter SFET
.
The record shown will be the first one in the next transaction. To confirm, the TransInd
field should be x00
.
Going to a Specific RBA in the File
To go to a specific RBA in the file, you can do either of the following:
-
To go to an RBA anywhere in the file:
Logdump 35> POS
rba
Logdump 36> NThis 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
Filtering Based on a Table or Data File Name
To filter out everything except records containing a specific NonStop data file name, enter the following command:
Logdump 60> FILTER INCLUDE FILENAME $volume
.subvolume
.file
To filter out everything except records containing a specific table name:
-
On a NonStop system:
Logdump 60> FILTER INCLUDE ANSINAME
catalog
.schema
.table
-
On a Windows or UNIX system:
Logdump 60> FILTER INCLUDE FILENAME [
container
|catalog
]schema
.table
Now, when you use the N
command, you will only see records that satisfy this filter. Conversely, to filter out records containing a specific table or file name, but show everything else, use the EXCLUDE
option instead of INCLUDE
.
Removing the Current Filter Criteria
To remove the current filter criteria, enter the following command:
Logdump 62> FILTER CLEAR
Filtering on Multiple Conditions
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 FILENAME
schema.table
; FILTER RECTYPE
record_type
; FILTER MATCH ALL
Use MATCH ANY
or MATCH ALL
depending on whether you want the search to match any or all of the filter conditions, respectively, when multiple conditions are specified. The preceding example filters on a name and record type, typically an operation type such as INSERT
.
Count the Records in a Trail File
The following command shows a count summary followed by counts for each table or data file:
Logdump 67> COUNT
Saving Records to a New Trail File
To save a subset of records, enter the following command:
Logdump 68> SAVEfile
n
RECORDS
Closing the Current File and Opening the Next One in the Trail
To close the current file and open the next one in the trail, enter the following command:
Logdump 69> NEXTTRAIL
Checking Trail File Encryption and Decrypting a Trail File
To read or check a trail file that is encrypted by OCI KMS, first setup the OCI KMS encryption profile correctly. To know more about encryption profile and how to set up an OCI KMS encryption profile, see Apply the OCI KMS Encryption Profile for Extract.
-
Set the following environment variables:
-
OGG_VAR_HOME
andOGG_ETC_HOME
environment variables to point to the/var
and/etc
directories of the corresponding Oracle GoldenGate deployment.export OGG_VAR_HOME=/app/Deployment/var
export OGG_ETC_HOME=/app/Deployment/etc
-
OGG_SSL_HOME
environment variable to point to the/ssl
directory of the Service Manager.export OGG_SSL_HOME=/app/ServiceManager/etc/ssl
-
-
Start
logdump
.shell> ./logdump
-
Open the trail file.
open /app/Deployment/var/lib/data/trail_name
For example:Logdump 47> open /app/Deployment/var/lib/data/tt000000001
Output:Current log trail file is /u02/Deployment/var/lib/data/tt000000001.
-
Set
decrypt
toon
state for the encryption profile. This would allow you to see the decrypted data in the trail file.decrypt on profile encryption_profile
For example:
Logdump 48> decrypt on profile OCIKMSTEST
If the encryption profile has been setup correctly, you will see a message similar to the following in logdump:Using encryption profile: OCIKMSTEST 2023-06-07 23:06:20 INFO OGG-25207 Loading master encryption key from Key Management System 'ocikms'. 2023-06-07 23:06:20 INFO OGG-25851 Using encryption profile 'OCIKMSTEST'.
-
Use the
detail data
andn
commands to view the decrypted trail file. Thedetail data
command displays data with hex and ASCII data values in the column list.Logdump 49>detail data Logdump 51>n
Following is the a sample excerpt of the trail file:
Logdump 52>n
2023/04/04 18:56:45.205.816 Metadata Len 382 RBA 4545 Table Name: WPDB.U1.TCUSTMER * 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 25)Remarks * TDR version: 11 Definition for table WPDB.U1.TCUSTMER Record Length: 78 Columns: 4 CUST_CODE 64 4 0 0 0 0 0 4 4 0 0 0 0 0 1 0 1 0 1 -1 0 0 0 NAME 64 30 10 0 0 0 0 30 30 0 0 0 0 0 1 0 0 0 1 -1 0 0 0 CITY 64 20 46 0 0 0 0 20 20 0 0 0 0 0 1 0 0 0 1 -1 0 0 0 STATE 0 2 72 0 0 0 0 2 2 0 0 0 0 0 1 0 0 0 96 -1 0 0 0 End of definition
Logdump 57> n
Oracle RBA : 0x000091.00018942.0010 2023/04/04 18:56:42.000.000 Insert Len 86 RBA 4994 Name: WPDB.U1.TCUSTMER (TDR Index: 1) After Image: Partition x0c G b 0000 0800 0000 0400 3030 3030 0100 2200 0000 1e00 | ........0000.."..... 6e4f 4f43 7678 7947 6f74 456d 766c 7a4d 4543 4262 | nOOCvxyGotEmvlzMECBb 6f43 5751 506d 7766 7569 0200 1800 0000 1400 4956 | oCWQPmwfui........IV 4f5a 5849 4e44 5542 4b49 4256 4e43 4a48 4f57 0300 | OZXINDUBKIBVNCJHOW.. 0400 0000 595a | ....YZ Column 0 (0x0000), Length 8 (0x0008). 0000 0400 3030 3030 | ....0000 Column 1 (0x0001), Length 34 (0x0022). 0000 1e00 6e4f 4f43 7678 7947 6f74 456d 766c 7a4d | ....nOOCvxyGotEmvlzM 4543 4262 6f43 5751 506d 7766 7569 | ECBboCWQPmwfui Column 2 (0x0002), Length 24 (0x0018). 0000 1400 4956 4f5a 5849 4e44 5542 4b49 4256 4e43 | ....IVOZXINDUBKIBVNC 4a48 4f57 | JHOW Column 3 (0x0003), Length 4 (0x0004). 0000 595a | ..YZ
Logdump 58>n
2023/04/04 18:56:45.219.345 Metadata Len 644 RBA 5304 Table Name: WPDB.U1.TCUSTORD * 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 25)Remarks * TDR version: 11 Definition for table WPDB.U1.TCUSTORD Record Length: 182 Columns: 7 CUST_CODE 64 4 0 0 0 0 0 4 4 0 0 0 0 0 1 0 1 0 1 -1 0 0 0 ORDER_DATE 192 19 10 0 0 0 0 19 19 19 0 5 0 0 1 0 1 0 12 -1 0 0 0 PRODUCT_CODE 64 8 32 0 0 0 0 8 8 0 0 0 0 0 1 0 1 0 1 -1 0 0 0 ORDER_ID 64 50 46 0 0 0 0 50 50 50 0 0 0 0 1 0 1 2 2 -1 0 0 0 PRODUCT_PRICE 134 10 102 2 0 0 0 8 8 8 0 0 0 0 1 0 0 3 2 -1 0 0 0 PRODUCT_AMOUNT 134 8 114 0 0 0 0 8 8 8 0 0 0 0 1 0 0 3 2 -1 0 0 0 TRANSACTION_ID 64 50 126 0 0 0 0 50 50 50 0 0 0 0 1 0 0 2 2 -1 0 0 0 End of definition
Keeping a Log of Your Session
To start logging, enter the following command:
Logdump 70> LOG TO filename
.txt
To write text to the log:
Logdump 71> WRITELOG "text
"
To stop logging:
Logdump 72> LOG STOP
Seeing the Current Logdump Environment
To see the current Logdump environment, enter the following command:
Logdump 73> ENV
This shows which features are enabled, such as filtering and header views, and it shows environment information such as the current trail and position.
Getting Online Command Help
To get online command help, enter the following command:
Logdump 74> HELP
Evaluating Transaction Size
Use Logdump's TRANSHIST
command in conjunction with other Logdump commands to determine whether or not your applications generate large transactions and to identify their relative size. TRANSHIST
causes Logdump to track the size of transactions contained in a trail file or extract file in an internal history table. The transactions are ranked in descending order of size, in bytes. When the history table is full, the smallest transaction is removed to allow a larger transaction to be added to the list.
To use statistics generated by TRANSHIST
, issue the following series of commands in Logdump:
Maintaining Command History
On Windows and UNIX systems, command history is stored in a file named logdump.hst
. On NonStop systems, command history is stored in a file named logduhst
. The file is created in the home location of the user who first started Logdump.
When Logdump starts up, it looks for the history file in one of the following locations, depending on the platform:
-
The
USERPROFILE
environment variable. -
The
$HOME
environment variable. -
The default
$
vol
.subvol
.
If the file exists, Logdump loads the command history into a buffer. The command history buffer holds 400 commands. Upon termination of the Logdump session, the session's history is appended to the file.
Viewing Logdump Command Information and Syntax
To learn more about Logdump commands, see the alphabetical reference documentation in Logdump Commands.