Ogg-01184 Expected 4 Bytes But Got — 0 Bytes In Trail
The error ogg-01184 expected 4 bytes but got 0 bytes occurs when GoldenGate’s reader reaches a point in the trail file where it expects to read the header, but the file ends abruptly. The system reads 0 bytes instead of 4. Common Causes (Root Cause Analysis) | Cause | Probability | Description | |-------|-------------|-------------| | Abnormal process termination | High | Extract or Pump process killed mid-write (kill -9, power failure, OOM killer) | | Filesystem full | Medium-high | Trail file write interrupted because disk filled to 100% | | Network corruption | Medium | NFS or network drive corruption during file transfer | | Manual editing/corruption | Low | Someone opened trail file in text editor or binary modification | | Version mismatch | Low | Reading trail written by newer OGG version with different record structure | How the Error Manifests in Logs A typical error stack in the ggserr.log looks like:
Record the current SCN on the source database for all replicated tables:
When this happens, your target database stops synchronizing. Data latency begins to grow. And if not handled correctly, you risk data divergence between source and target. ogg-01184 expected 4 bytes but got 0 bytes in trail
Find the transaction ID (XID) of the corrupt record. In logdump :
If the file is partially recoverable, use logdump to write a clean trail: The error ogg-01184 expected 4 bytes but got
#!/bin/bash for trail in /u01/gg/dirdat/rt*; do echo "checking $trail" echo "open $trail" > /tmp/logdump_cmd echo "n" >> /tmp/logdump_cmd echo "q" >> /tmp/logdump_cmd /u01/gg/logdump < /tmp/logdump_cmd | grep -i "error\|corrupt\|unexpected" done Scenario: A large financial firm replicates a 10TB Oracle database. One night, a backup job fills the /goldengate filesystem to 100%. The Extract continues writing but fails to complete the last record in rt000241 .
ggsci> STOP EXTRACT * ggsci> STOP REPLICAT * ggsci> STOP MANAGER Abrupt termination is the #1 cause of “expected 4 bytes but got 0”. Create a daily logdump validator: Data latency begins to grow
| Field | Size | Description | |-------|------|-------------| | Record Length | 4 bytes | Indicates the total size of the following data | | Record Data | Variable | Actual change data in canonical format | | Checksum (optional) | 4 bytes | Integrity check |