Analyze Outstanding Transactions in the Replication Log
You can use the -logAnalyze
command in the
ttXactLog
utility to analyze the replication logs.
You can determine the following:
-
Measure how much is left to replicate from a master to any subscribers at the current time. When replication seems to be taking longer than expected, you can determine how many transactions are left to replicate or if replication is processing a long-running transaction.
-
Measure if the current configuration distributes the load appropriately across all manual and automatic tracks for parallel replication.
Run the log analyze command against a particular data store to generate the following information:
-
The number of transactions that are waiting to be replicated. For each transaction that has not been replicated, the information collected includes the number of operations for each transaction and the total size of each transaction (including partial roll backs).
-
The amount of operations left in each transaction including its specific type (either DDL or DML) and how many of each statement type are in each transaction. The tool also generates the total size of every operation left to replicate.
-
Retrieves information on how the workload is split across tracks. When you use manual parallel replication, you can use
-logAnalyze
to monitor whether the application is distributing work evenly across the replication tracks. -
Returns the largest transaction left to replicate.
-
Returns the start and end LSN. The start LSN is the starting point in the transaction log where the transmitter starts reading; the end LSN is the end of the transaction log.
Note:
In the transaction log analysis output, transactions are shown in commit order.
You can specify how much information is displayed with the verbose command. For example, when you set verbose to 1, the following is displayed:
% ttXactLog -v1 -logAnalyze rep1 Summary: Total transactions left to replicate: 4 Total rows left to replicate: 4 Size of transactions left to replicate: 1.86 KiB Size of rows left to replicate: 488.00 B Total inserts remaining: 4 Total partial rollbacks: 5 Total rollbacks: 3 Start LSN = 0.3793736 End LSN = 0.18769920
If a subscriber is specified, then the summary displays only for that particular subscriber. However, by default, the summary is displayed for all subscribers.
When you specify verbose to 2, then the information includes both a summary of each parallel track in addition to the overall summary information.
% ttXactLog -v2 -logAnalyze rep1 Track analysis for track number: 0 Transactions left to replicate: 2 Rows left to replicate: 2 Size of transactions left to replicate: 880.00 B Size of rows left to replicate: 312.00 B Total inserts remaining: 1 Total partial rollbacks: 4 Track analysis for track number: 1 Transactions left to replicate: 2 Rows left to replicate: 2 Size of transactions left to replicate: 1.14 KiB Size of rows left to replicate: 244.00 B Total inserts remaining: 2 Total partial rollbacks: 1 Total rollbacks: 3 Summary: Total transactions left to replicate: 4 Total rows left to replicate: 4 Size of transactions left to replicate: 2.00 KiB Size of rows left to replicate: 556.00 B Total inserts remaining: 3 Total partial rollbacks: 5 Total rollbacks: 3 Start LSN = 0.3793736 End LSN = 0.20506624
When you provide the verbose level 3, the information generated includes a transaction analysis that includes a description of the contents of every transaction in every track:
% ttXactLog -v3 -logAnalyze rep1 Transaction id: 3.10 Track for this xid: 1 Logmarker before this xid: 275 Rows left to replicate: 1 Transaction size: 800.00 B Size of rows left: 122.00 B Total inserts remaining: 1 Transaction id: 2.1 Track for this xid: 0 Logmarker before this xid: 276 Rows left to replicate: 1 Transaction size: 368.00 B Size of rows left: 122.00 B Total inserts remaining: 1 Transaction id: 2.19 Track for this xid: 1 Logmarker before this xid: 823 Rows left to replicate: 1 Transaction size: 368.00 B Size of rows left: 122.00 B Total inserts remaining: 1 Transaction id: 3.2 Track for this xid: 0 Logmarker before this xid: 842 Rows left to replicate: 1 Transaction size: 368.00 B Size of rows left: 122.00 B Total inserts remaining: 1 Track analysis for track number: 0 Transactions left to replicate: 2 Rows left to replicate: 2 Size of transactions left to replicate: 736.00 B Size of rows left to replicate: 244.00 B Total inserts remaining: 2 Total partial rollbacks: 4 Track analysis for track number: 1 Transactions left to replicate: 2 Rows left to replicate: 2 Size of transactions left to replicate: 1.14 KiB Size of rows left to replicate: 244.00 B Total inserts remaining: 2 Total partial rollbacks: 1 Total rollbacks: 3 Summary: Total transactions left to replicate: 4 Total rows left to replicate: 4 Size of transactions left to replicate: 1.86 KiB Size of rows left to replicate: 488.00 B Total inserts remaining: 4 Total partial rollbacks: 5 Total rollbacks: 3 Start LSN = 0.3793736 End LSN = 0.21444608
When you specify the XID, the tool displays verbose level 3 output where the transaction analysis is based on the XID. If an XID is used by two separate transactions, the report shows with the LogMarker
entry the nearest point in the transaction log just before the start of each transaction.
% ttXactLog -logAnalyze -xid 2.19 rep1; Transaction id: 2.19 Track for this xid: 1 Logmarker before this xid: 823 Rows left to replicate: 1 Transaction size: 368.00 B Size of rows left: 122.00 B Total inserts remaining: 1 Track analysis for track number: 0 Transactions left to replicate: 0 Rows left to replicate: 0 Size of transactions left to replicate: 0.00 B Size of rows left to replicate: 0.00 B Track analysis for track number: 1 Transactions left to replicate: 1 Rows left to replicate: 1 Size of transactions left to replicate: 368.00 B Size of rows left to replicate: 122.00 B Total inserts remaining: 1 Summary: Total transactions left to replicate: 1 Total rows left to replicate: 1 Size of transactions left to replicate: 368.00 B Size of rows left to replicate: 122.00 B Total inserts remaining: 1 Start LSN = 0.3793736 End LSN = 0.20514816
Note:
See ttXactLog in the Oracle TimesTen In-Memory Database Reference.