Replication of data is always a fun thing to look at; What is replicating?! Discussions around, How do I get data from server/database A to server/database B or even to server/database C are valid questions and are often asked by management. Often the simple (knee jerk) answer is, just set it up and start replicating. Although Oracle GoldenGate may be simple (for some architectures) to meet the demands of management and the task at hand, problems will arise with the data being replicated.
when problems arise, the need to identify and resolve the replication issue becomes a critical and time consuming task. Oracle GoldenGate provides a few utility to help in diagnosing and resolving replication issues. One such utility is the LogDump utility. The LogDump utility is used to read the local and remote trail files that are used to support the continuous extraction and replication of transaction changes within the database.
Knowing what trail files are used for is part of the battle when troubleshooting replication issues with Oracle GoldenGate. How do we use LogDump to read these trail files? What are we looking for or at in a trail file to understand what is gong on? To answer these questions, we need to start the LogDump utility.
To start LogDump, we just need to be in the OGG_HOME and run the LogDump command. The below code set shows you how to run LogDump.
[[email protected] oggcore_1]$ pwd
[[email protected] oggcore_1]$ ./logdump
Oracle GoldenGate Log File Dump Utility for Oracle
Version 22.214.171.124.0 17185003 17451407
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
Logdump 22 >
Note: Your LogDump session should start at 1 not 22 (Logdump 22). LogDump remembers session info until you log out of the server.
Once LogDump has been started, we need to open a trail file and setup how we want the information to be displayed. Commands for LogDump can be displayed by using the “help” command. In the following code block, we see that we are opening a local trail (lt) file and setting a few environment options.
Note: Trail files (local and remote) normally are pre-fixed with two (2) letters followed by a six ( 6 ) digit string. In new environments trail files will start with (prefix)000000 (lt000000 or rt000000).
Logdump 15 >open ./dirdat/lt000000
Current LogTrail is /oracle/app/product/12.1.2/oggcore_1/dirdat/lt000000
Logdump 16 >ghdr on
Logdump 17 >detail on
Logdump 18 >detail data
Logdump 19 >usertoken on
Logdump 20 >
The “help” command inside of LogDump provides more options. The options that we are using in this example are:
- ghdr on = toggle header display on | off
- detail on = toggle detailed data display (on | off | data)
- detail data = toggle detailed data display (on | off | data) (repeated this just to make sure)
- usertoken on = show user token information (on | off| detail)
With the LogDump environment set, we can now use the “next (n)” command to see the information in the trail file.
Logdump 20 > n
Once the header output is displayed, we need to understand how to read this information. Image 1 provides us with a quick explanation of each major component within a trial file transaction. We can see the following items for a transaction in trail file (lt000000):
- Header Area: Transaction information
- Data/Time and type of transaction
- Object associated with the transaction
- Image of transaction (before/after)
- Columns associated with the transaction
- Transaction data formatted in Hex
- Length of the record
- ASCII format of the data
- Record position within the trail file (RBA)
Image 1: Header Information
At this point, we maybe asking: Why is this important? Understanding the trail files and how to find information within the trail files is an important part of troubleshooting the Oracle GoldenGate environment.
Example: If a replicat abends and we need to start the replicat from a given RBA. Being able to identify the first, next and last RBA in the trail file is helpful in understanding why the abend happened and identifying a starting point to restarting successfully.
In the end, the Oracle GoldenGate environment can be simple yet complex at the same time. Understanding the different components of the environment is very useful and worth the time involved to learn it.