When running Oracle GoldenGate in production, it’s essential to keep track of how many operations are being replicated across tables. Fortunately, GoldenGate Microservices provides a REST API that makes this task easy and scriptable.

In this example, we use a simple curl command to send the STATS request to an Extract process, asking for hourly statistics. By combining it with jq, we can transform the JSON response into a clean, readable view of activity by table.

The output shows per-table metrics such as:

  • Source and target table names
  • Time window (since)
  • Insert, update, delete, upsert, and discard counts
  • Operations and metadata records

This approach gives DBAs and developers a lightweight way to monitor data flow without logging into the GoldenGate Admin UI. It also makes it easy to integrate replication statistics into monitoring pipelines, dashboards, or troubleshooting workflows.

With just a single REST API call and some JSON parsing, you gain real-time visibility into replication activity at the table level, helping you confirm workload patterns, validate change capture, and troubleshoot issues faster.

# Check the table statistics

curl -s --location --request POST 'http://localhost:9012/services/v2/extracts/EWEST/command' \

  --netrc-file ~/.ogg_netrc.sh \

  --data '{"command": "STATS", "arguments": "HOURLY"}' \

| jq '

  .response.replyData.stats[]

  | select(.sourceTable? != null and (.operations | type == "array"))

  | {

      sourceTable: .sourceTable,

      targetTable: .targetTable,

      since: .since,

      insert:     ([.operations[] | select(.operation == "insert")          | .count] | add // 0),

      update:     ([.operations[] | select(.operation == "update")          | .count] | add // 0),

      delete:     ([.operations[] | select(.operation == "delete")          | .count] | add // 0),

      upsert:     ([.operations[] | select(.operation == "upsert")          | .count] | add // 0),

      discard:    ([.operations[] | select(.operation == "discard")         | .count] | add // 0),

      operations: ([.operations[] | select(.operation == "operations")      | .count] | add // 0),

      metadata:   ([.operations[] | select(.operation == "metadataRecords") | .count] | add // 0)

    }'

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.