GoldenGate Extract Status with Automation (API)

Here’s a REST API call you can use to check the status of a GoldenGate extract, along with some details:

Request

Bash

curl -u 'oggadmin:your_password' \
  -X GET 'http://your_goldengate_host:9011/services/v2/extracts/your_extract_name/info/status'
  • -u ‘oggadmin:your_password’: Replace oggadmin with your GoldenGate username and your_password with the corresponding password. These credentials are needed for authentication.
  • -X GET: Indicates you’re sending a GET request to retrieve data.
  • http://your_goldengate_host:9011: Replace your_goldengate_host with the actual hostname or IP address where your GoldenGate service is running.
  • /services/v2/extracts/your_extract_name/info/status: The API endpoint to access status information. Replace your_extract_name with the name of the extract you want to check.

Example

Bash

curl -u 'oggadmin:securepass' \
  -X GET 'http://goldengate-server:9011/services/v2/extracts/EXT_SRC/info/status'

Response

A successful response will return a JSON object with details about the extract’s status:

JSON

{
  "$schema": "ogg:extractStatus",
  "lag": 0,
  "lastStarted": "2024-06-11T14:35:20.000Z",
  "position": {
    "rba": 123456
  },
  "processId": 1234,
  "sinceLagReported": 15,
  "status": "RUNNING"
}

Key Fields

  • status: The current state of the extract (“RUNNING”, “STOPPED”, “ABENDED”.).
  • lag: The lag time in seconds.
  • position: Information about the current position of the extract in the transaction log.

Important Notes

  • Version: Make sure you use the correct API version (“v2” in this example). GoldenGate REST APIs may change in future releases.
  • Security: Never expose your GoldenGate credentials in plain text. Consider using environment variables or a secure password management tool.
  • Error Handling: Be prepared to handle errors like 401 Unauthorized (incorrect credentials) or 404 Not Found (extract doesn’t exist).

Using the Output

You can use this output to monitor the health and progress of your GoldenGate extract. You could write a script to automate this check or use a monitoring tool that can integrate with the REST API.

Let me know if you’d like help adapting this for a specific scenario or incorporating it into a script!

Leave a comment

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