onstat -g ddr: Print status of ER log reader
Prints the status of the Enterprise Replication database log reader.
The ddr, or ddr_snoopy, is an internal component of Enterprise Replication that reads the log buffers and passes information to the grouper.
You can use the information from the onstat -g ddr command to monitor replay position in the log file and ensure replay position is never overwritten (which can cause loss of data). The replay position is the point from where, if a system failure occurs, Enterprise Replication starts re-reading the log information into the log update buffers. All the transactions generated before this position at all the target servers have been applied by Enterprise Replication or safely stored in stable queue space. As messages are acknowledged or stored in the stable queue, the replay position should advance. If you notice that replay position is not advancing, this can mean that the stable queue is full or a remote server is down.
The onstat -g ddr output shows you a snapshot of the replay position, the snoopy position, and the current position. The snoopy position identifies the position of the ddr_snoopy thread in the logical logs. The ddr_snoopy has read the log records up until this point. The current position is the position where the server has written its last logical log record.
If log reading is blocked, data might not be replicated until the problem is resolved. If the block is not resolved, the database server might overwrite the read (ddr_snoopy) position, which means that data will not be replicated. If this occurs, you must manually resynchronize the source and target databases.
- Have 24 hours of online log space available.
- Keep the log file size consistent. Instead of having a single large log file, implement several smaller ones.
- Avoid switching logical logs more than once per hour.
- Keep some distance between LTXHWM (long-transaction high-watermark) and LTXEHWM (long-transaction, exclusive-access, high-watermark).
You can configure one or more actions to occur if the current position reaches the log needs position by setting the CDR_LOG_LAG_ACTION configuration parameter.
The following sample output from the onstat ddr command shows the replay position, snoopy position, and current position highlighted.
DDR -- Running --
# Event Snoopy Snoopy Replay Replay Current Current
Buffers ID Position ID Position ID Position
2064 35 2ae050 34 121018 55 290000
Log Pages Snooped:
From From From Staging Tossed
Cache Disk File (LBC full)
0 0 19704 0
CDR log records ignored : 0
DDR log lag state : On
Current DDR log lag action : logstage
DDR log staging disk space usage :0.26%
Maximum disk space allowed for log staging :1048576 KB
Maximum disk space ever used for log staging :2746.98 KB
Current staged log file count :21
Total dynamic log requests: 0
DDR events queue
Type TX id Partnum Row id