Adding Credential Heartbeat Trandata Checkpkoint &Operator using Rest API oracle goldengate 26ai read&learn gg

Photo by Towfiqu barbhuiya on Unsplash
Adding Database Credential , Heartbeat table , Trandata and Checkpoint table are the pre-requisites before adding an extract or replicat . This blog covers rest api calls to add all of them including adding a Operator Role using Rest API of goldengate 26ai microservices deployment.
Variables
source dbname > PRODSRCDB
target dbname > PRODTRGDB
:domain > OracleGoldenGate
:alias > oggadmin
baseurl (for source) > myhost1.example.com
baseurl (for target) > myhost2.example.com
:version > v2
goldengate schema > oggadmin
db schema > SALES
:role > Operator
Adding Database Credential
After logging to adminclient we add the database credential for centralized and secure authentication of goldengate to source and targets. The secrets are stored in a secure oracle wallet of the home directory of the user executing it. Below is the curl command adding the credential. Before you run this curl command, create the user “oggadmin” in the database “PRODSRCDB” with a password of your choice.
# API {{baseUrl}}/services/:version/credentials/:domain/:alias
# 1. Creating Database Connection Credential
curl -u 'oggadmin:oggadmin123' \
-X POST myhost1.example.com:6201/services/v2/credentials/OracleGoldenGate/oggadmin \
-H 'Content-Type: application/json' -H 'Accept: application/json' \
-d '{"userid": "oggadmin@PRODSRCDB", "password": "oggadmin123"}'
Heartbeat Table
Heartbeat Table captures information of outgoing(extract) and incoming(replicat) replication streams along with timestamps. They are useful in capturing replication lags. Below curl command creates a heartbeat table. It’s frequency of validating heartbeats is 300s , retains these records for 4 days and purges older records everyday( 1 day).
# API {{baseUrl}}/services/:version/connections/:connection/tables/heartbeat
# 2. Create Heartbeat Table
curl -u 'oggadmin:oggadmin123' \
-X POST 'http://myhost1.example.com:6201/services/v2/connections/OracleGoldenGate.oggadmin/tables/heartbeat' \
-H 'Content-Type: application/json' -H 'Accept: application/json' \
-d '{
"frequency": 300,
"purgeFrequency": 1,
"retentionTime": 4
}'
Trandata
Adding Trandata instructs oracle goldengate to add additional column info into redo logs. GoldenGate replication identifies each row uniquely while replicating; therefore, the database logs primary or unique key information. If a table lacks a primary or unique key, the system logs all columns for unique identification. Below curl command adds trandata to all the tables of schema “SALES” .
#API {{baseUrl}}/services/:version/connections/:connection/trandata/schema
# 3. Adding Trandata for whole schema "SALES"
curl -u 'oggadmin:oggadmin123' \
-X POST 'http://myhost1.example.com:6201/services/v2/connections/OracleGoldenGate.oggadmin/trandata/schema' \
-H 'Content-Type: application/json' -H 'Accept: application/json' \
-d '{
"$schema": "ogg:trandataSchema",
"operation": "add",
"schemaName": "SALES",
"schedulingColumns": true
}'
# API to add trandata of single table
{{baseUrl}}/services/:version/connections/:connection/trandata/table
Checkpoint Table
Checkpoint table tracks the progress of replicat process . How far has replicat read the target trail files . This table is created at the target database . Helps goldengate during restart and recovery, prevents data loss or duplication.
#API {{baseUrl}}/services/:version/connections/:connection/tables/checkpoint
# 4. Create Checkpoint Table
curl -u 'oggadmin:oggadmin123' \
-X POST 'http://myhost2.example.com:6201/services/v2/connections/OracleGoldenGate.oggadmin/tables/checkpoint' \
-H 'Content-Type: application/json' -H 'Accept: application/json' \
-d '{
"operation": "add",
"name": "oggadmin.checkpoint"
}'
Operator Role
A user is created on the target database with Operator role assigned . Operator role grants user start/stop and monitor process privileges. The distribution service of source connects to receiver service on target , it does this with a user having operator role. This is not a database user but a goldengate microservice user .
#API {{baseUrl}}/services/:version/authorizations/:role/:user
# 5. Assign Operator Role on Target Server
curl -u 'oggadmin:oggadmin123' \
-X POST 'http://myhost2.example.com:6201/services/v2/authorizations/Operator/GGODIST' \
-H 'Content-Type: application/json' -H 'Accept: application/json' \
-d '{
"credential": "oggadmin123",
"info": "PRODSRCDB-PRODTRGDB"
}'
To get more API’ s check my previous blog. https://thebrewtech.com/rest-api-oracle-goldengate-26ai-readlearn-gg/
Ref:
https://alexlima.com/add-schematrandata-checkpoint-and-heartbeat-table-rest-api/
https://app.swaggerhub.com/apis-docs/ALEXLIMA_1/ogg_23_ai_api_docs/2025.04.15#/
https://docs.oracle.com/en/database/goldengate/core/26/oggra/