You first need to break down the lag time using the heartbeat table, this can help you to find out where the lag happens.
If it happens on extract side, you can
- Restrict the extract to only data that you are interested in replication with limited enabling of supplemental logging and table section in the extract.
- Increase the IO (especially write) throughput of the machine running GoldenGate Extract.
- Avoid having long transactions
If it happens during pumping the data to the target, you can
- Remove unnecessary processing in the pump
- Try Use the COMPRESSION feature
- Optimize the network delivery by increasing the TCPBUFSIZE and the TCPFLUSHBYTES size.
If it happens on the replicat side,
- Optimize the target database SQL execution
- Parallelize the replicat apply with integrated(IR) or coordinate replicat(CR) features.
- Use BATCHSQL
- The Trouble Shooting and Tuning Guide: http://docs.oracle.com/cd/E35209_01/doc.1121/e35180.pdf
- Note 1304557.1: Main Note - Oracle GoldenGate - Lag, Performance, Slow and Hung Processes