These are the examples of curl API calls to perform the following administrative tasks in Oracle GoldenGate: adding schema trandata, adding a checkpoint table, and adding a heartbeat table. Let’s break down each operation.

Adding Schema Trandata

To add schema-level supplemental logging (trandata) for a database connection, you can use a POST request to the /services/{version}/connections/{connection}/trandata/schema endpoint. The API version is v2. You will need to replace {connection} with the name of your database connection.

To add trandata, the operation field should be set to “add”, and you must specify the schemaName. You can also specify other optional parameters like nonvalidatedKeysAllowed, schedulingColumns, and allColumns.

Here is an example curl command to add schema trandata for the HR schema using the connection OracleGoldenGate.ggnorth:

curl -i -X POST \
-H "Content-Type: application/json" \
-u <username>:<password> \
-d '{
  "$schema": "ogg:trandataSchema",
  "operation": "add",
  "schemaName": "HR",
  "schedulingColumns": true
}' \
http://<hostname>:<port>/services/v2/connections/OracleGoldenGate.ggnorth/trandata/schema

Explanation:

  • -X POST: Specifies the HTTP POST method.
  • /services/v2/connections/OracleGoldenGate.ggnorth/trandata/schema: The API endpoint for managing schema trandata. Replace OracleGoldenGate.ggnorth with your connection name.
  • -d ‘{ … }’: The JSON request body.
    • “$schema”: “ogg:trandataSchema”: Identifies the schema of the request body.
    • “operation”: “add”: Specifies the operation to add trandata.
    • “schemaName”: “HR”: The name of the schema for which to enable trandata.
    • “schedulingColumns”: true: An example of an optional parameter to enable supplemental logging for key columns.

A successful request will likely return a 200 OK status code.

Adding a Checkpoint Table

To create Oracle GoldenGate checkpoint tables, you can use a POST request to the /services/{version}/connections/{connection}/tables/checkpoint endpoint. The API version is v2. Replace {connection} with your database connection name.

To add a checkpoint table, the operation field should be “add”, and you need to specify the name of the checkpoint table.

Here is an example curl command to add a checkpoint table named ggadmin.ggs_checkpoint using the connection OracleGoldenGate.ggsouth:

curl -i -X POST \
-H "Content-Type: application/json" \
-u <username>:<password> \
-d '{
  "$schema": "ogg:tablesGeneric",
  "operation": "add",
  "name": "ggadmin.ggs_checkpoint"
}' \
http://<hostname>:<port>/services/v2/connections/OracleGoldenGate.ggsouth/tables/checkpoint

Explanation:

  • -X POST: Specifies the HTTP POST method.
  • /services/v2/connections/OracleGoldenGate.ggsouth/tables/checkpoint: The API endpoint for managing checkpoint tables. Replace OracleGoldenGate.ggsouth with your connection name.
  • -d ‘{ … }’: The JSON request body.
    • “$schema”: “ogg:tablesGeneric”: Identifies the schema of the request body.
    • “operation”: “add”: Specifies the operation to add a checkpoint table.
    • “name”: “ggadmin.ggs_checkpoint”: The fully qualified name of the checkpoint table.

A successful request will likely return a 200 OK status code.

Adding a Heartbeat Table

To create a heartbeat table for a database connection, you can use a POST request to the /services/{version}/connections/{connection}/tables/heartbeat endpoint. The API version is v2. Replace {connection} with your database connection name.

Here is an example curl command to create a heartbeat table using the connection OracleGoldenGate.ggsouth. This example includes some optional parameters from the ogg:tablesHeartbeat schema:

curl -i -X POST \
-H "Content-Type: application/json" \
-u <username>:<password> \
-d '{
  "$schema": "ogg:tablesHeartbeat",
  "frequency": 30,
  "purgeFrequency": 7,
  "retentionTime": 60,
  "targetOnly": false,
  "trackingExtractRestart": true
}' \
http://<hostname>:<port>/services/v2/connections/OracleGoldenGate.ggsouth/tables/heartbeat

Explanation:

  • -X POST: Specifies the HTTP POST method.
  • /services/v2/connections/OracleGoldenGate.ggsouth/tables/heartbeat: The API endpoint for creating a heartbeat table. Replace OracleGoldenGate.ggsouth with your connection name.
  • -d ‘{ … }’: The JSON request body.
    • “$schema”: “ogg:tablesHeartbeat”: Identifies the schema of the request body.
    • “frequency”: 30: Sets the heartbeat frequency to 30 seconds.
    • “purgeFrequency”: 7: Sets the purge frequency for the history table to 7 days.
    • “retentionTime”: 60: Sets the retention time for heartbeat records to 60 days.
    • “targetOnly”: false: Indicates whether supplemental logging and scheduler jobs are enabled.
    • “trackingExtractRestart”: true: Specifies if the heartbeat table tracks extract restart.

A successful request will likely return a 201 Created status code. You should consult the Oracle GoldenGate documentation for the exact required and optional parameters for creating a heartbeat table via the REST API for your specific version.

https://docs.oracle.com/en/middleware/goldengate/core/23/oggra

Quote of the week

“Control what I can control”

~ Alex Lima