Logdump is a trail file analysis tool provided by GoldenGate. It is worth the time to study the working principle of GoldenGate.
By default, the Logdump component is in the installation directory, which is an executable file, as shown in figure 6.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/21453124R-0.jpg "title =" 1.jpg"/>
Figure 6
Enter logdump and press enter To Go To The logdump page, as shown in figure 7.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/21453134a-1.jpg "title =" 2.jpg"/>
Figure 7
1. Understand logdump analysis tools and Common commands
There are not many logdump commands that are often used. After Entering the logdump command line, you can directly enter help to view each command, as shown in Figures 8 and 9.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/2145315441-2.jpg "title =" 3.jpg"/>
Figure 8
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/21453114V-3.jpg "title =" 4.jpg"/>
Figure 9
The Common commands are as follows.
Usertoken is used to display some tag information of the trail file.
Ggstoken displays some GoldenGate tag information.
The Headertoken displays the header tag information.
Ghdr on is used to open the recorded header information.
Pos first | last | for | rev, where pos for | rev is important. It is used to specify the upward and downward directions for reading in the trail file ).
Count detail displays the total number of records of the current trail file, as shown in 10.
Other commands are easy to understand.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/2145312945-4.jpg "title =" 5.jpg"/>
Figure 10
2. Understand the file format and common analysis ideas of trail
Understanding the format of the trail file is very important for understanding the working principle of GoldenGate and also helpful for troubleshooting, as shown in Figure 11.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/2145312R2-5.jpg "title =" 6.jpg"/>
Figure 11
A trail file starts with the header information of the file, then the recorded header information, and then the detailed information of the record. GoldenGate processes records in transaction units. Therefore, the time recorded by the trail file is the commit time, as shown in 12.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/2145313260-6.jpg "title =" 7.jpg"/>
Figure 12
The record in the Trial file in the same thing is uniquely determined by the I/O time and AuditRBA values, as shown in Figure 13.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/214531M42-7.jpg "title =" 8.jpg"/>
Figure 13
Which part of the current transaction is recorded by TransInd, as shown in figure 14.
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/2145316401-8.jpg "title =" 9.jpg"/>
Figure 14
The working principle of GoldenGate can be understood as that the source extraction process extracts the corresponding DML operation information and data from the redo log by transactions, and then writes the data to the local trail file in chronological order, then, the delivery process at the source end interacts with the MGR process and Extract process at the disaster recovery end. by reading the information of the trail file, the data is delivered to the disaster recovery end through the TCP/IP protocol. Then, the disaster recovery Replicat process converts the data to an SQL statement and updates the data in the database by reading and shipping the trail file. This completes data replication.
After learning about this layer, if there is a problem with the GoldenGate link or the trail file is damaged, you can analyze the corresponding checkpoint through logdump, re-extract, ship, or copy it, this can repair damaged links.
3. Logdump Guide
Use the following command in GGSCI to view the currently processed queue file and RBA number, for example:
Example 47:
GGSCI br-jl-accs-db1) 3> info REPYXA
Replicat repyxa Last Started Status RUNNING
Checkpoint Lag 00:00:00 updated 136: 41: 42 ago)
Log Read Checkpoint File./dirdat/p1000556 First Record RBA 59193235
Run the logdump command in the GoldenGate installation directory to open the queue file to be viewed:
Example 48:
Logdump 1> open./dirdat/p1000556
Current LogTrail is./dirdat/p1000556
Logdump 2> ghdr on
Logdump 3> detail on
Logdump 4> detail data
Logdump 5> usertoken on
Logdump 6> RBA number displayed by INFO command on pos 59193235
Logdump 7> n
Continue to input n to display the currently processed tables and related operations.