Navigate to the directory where the Oracle GoldenGate Software is installed and execute the Logdump.
To open a trail file and read it’s content, specify the trail file at the logdump prompt. Trail files are usually found in the GoldenGate dirdat directory.
ls -lrt $GG_HOME/dirata
-rw-rw-rw- 1 oracle oinstall 78325 Dec 7 10:38 EE000001
-rw-rw-rw- 1 oracle oinstall 78325 Dec 7 10:42 EE000002
-rw-rw-rw- 1 oracle oinstall 78325 Dec 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.
Open and view the details of local trail file.
Logdump> OPEN ./dirdat/EE000001
Enable the following options so that you are able to view the results in a readable format in your Logdump sessionL
Set trail file header detail on
The FILEHEADER contains the header details of the currently opened trail file.
Logdump> FILEHEADER DETAIL
Logdump> GHDR ON
Set Column Details on
It displays the list of columns, their ID, length, Hex values etc.
Logdump> DETAIL ON
User token details
User token is the user defined information stored in 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
Set length of the record to be displayed
In this case it is 128 characters.
Logdump> RECLEN 128
To view particular records in the trail files, navigate as below in the local trail file.
First record in the trail file
Here “0” is the beginning of the trial file
Logdump> POS 0
Logdump> POS xxxx
Next record in the opened trail file
Moving forward or reverse in the trail file
Logdump> POS FORWARD
Logdump> POS REVERSE
Skip certain number of records
Here ‘x’ is the number of records you want to skip.
Logdump> SKIP x
Logdump> POS last
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.
Show the Record Types
Logdump> SHOW RECTYPE
Enable or disable filtration
Logdump> FILTER [ ENABLE | DISABLE ]
Filter Records by Table Name
Logdump> FILTER INCLUDE FILENAME CC_APP.IMAGE_DETAIL
Filter Records By Operation Type
Operation types are Insert, Update, and Delete.
Logdump> FILTER INCLUDE IOTYPE INSERT
Logdump 374> FILTER INCLUDE IOTYPE 160
Logdump 374> N
2013/02/18 00:36:05.000.000 DDLOP Len 1169 RBA 3049
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.
View currently applied filters
Logdump> FILTER SHOW
Data filters are ENABLED
Include Match ANY
Rectypes : DDLOP
Exclude Match ANY
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
Note: [SCHEMA] & [TABLE] is the name of the schema and table, and should be in upper case.
Clear the filter in the session
Logdump> FILTER CLEAR
Count of the records in trail file
Logtrail /u01/GoldenGate/dirdat/ST000010 has 5 records
Total Data Bytes 2161
Avg Bytes/Record 432
After Images 4
Average of 4 Transactions
Bytes/Trans ..... 600
Records/Trans ... 1
Files/Trans ..... 1
It will display the count of DDL, DML, DCL (Commit or Rollback) operations, etc.
Display count details
Logdump> COUNT DETAIL
Sample Output of Addition Data:
Total Data Bytes 1194
Avg Bytes/Record 597
After Images 2
*FileHeader* Partition 0
Total Data Bytes 931
Avg Bytes/Record 931
Search for large transaction
Logdump>FILTER INCLUDE FILENAME CC_APP.IMAGE_DETAIL
Previously used commands in the current Logdump
Scan for next good header of record
The above command will show the next good header of the record in
the trail file.
2013/02/18 00:36:52.797.000 FileHeader Len 931 RBA 0
3000 01c5 3000 0008 4747 0d0a 544c 0a0d 3100 0002 | 0...0...GG..TL..1...
0002 3200 0004 2000 0000 3300 0008 02f1 fc23 c46f | ..2... ...3......#.o
2448 3400 0047 0045 7572 693a 6368 642d 706b 6175 | $H4..G.Euri:LOCAL
7368 616c 323a 5345 4153 4941 3a52 4f4f 543a 5345 | MACHINE
4153 4941 434f 4e53 554c 5449 4e47 3a43 4f4d 3a64 | :d
7269 7665 2d44 3a67 6f6c 6465 6e67 6174 6536 0000 | rive-D:GoldenGate6..
1500 1364 3a5c 7465 7374 5c6d 315c 6574 3030 3030 | ... /u01/GoldenGate/dirdat/ST0000
Scan for end of the transaction
Some of the other SCAN options are:
Open the next trail file
Logtrail /u01/GoldenGate/dirdat/ST000010 closed
Current Logtrail is /u01/GoldenGate/dirdat/ST000011
For example if we had the trail file ST000010 opened, the
NEXTTRAIL command will open the next trailfile, ST000011.
We can save the records of trail file to a new trail file
Save all contents of the trail file
Logdump> SAVE [file]
Save the subset of data
Set the filter condition for the table we want data.
Logdump> FILTER EXCLUDE FILENAME [SCHEMA].[TABLE]
Logdump> SAVE [file] [n] RECORDS