GoldenGate Add Replicat (Part 4 – REST API Series)

I will now demonstrate how to add the RDEMO Replicat. Note that the configuration is a remote capture and remote apply. Therefore Distribution Service is not require in this demo.

Current configuration has the EDEMO extract created on PART 3 of this series.

curl -s -u oggadmin:”xxxxx” \
-H “Accept: application/json” \
-X POST http://localhost:9011/services/v2/replicats/RDEMO \
-d ‘{
“description”:”Create Replicat Demo”,
“config”:[
“REPLICAT RDEMO”,
“USERIDALIAS OGG_TRG_PDB DOMAIN OracleGoldenGate”,
“GETTRUNCATES”,
“DDL INCLUDE MAPPED”,
“MAP srcpdb.hr., TARGET hr.;”
],
“checkpoint”: {“table”: “c##ggadmin.ogg_checkpoint”},
“credentials”: {“alias”: “OGG_TRG_PDB”},
“mode”: {“parallel”: true,”type”: “integrated”},
“registration”: “none”,
“source”: {“name”: “ed”},
“status”: “running”
}’ \
| json_reformat

-bash-4.2$ curl -s -u oggadmin:"xxxx" \
> -H "Accept: application/json" \
> -X POST http://localhost:9011/services/v2/replicats/RDEMO \
> -d '{
> "description":"Create Replicat Demo",
> "config":[
> "REPLICAT RDEMO",
> "USERIDALIAS OGG_TRG_PDB DOMAIN OracleGoldenGate",
> "GETTRUNCATES",
> "DDL INCLUDE MAPPED",
> "MAP srcpdb.hr.*, TARGET hr.*;"
> ],
> "checkpoint": {"table": "c##ggadmin.ogg_checkpoint"},
> "credentials": {"alias": "OGG_TRG_PDB"},
> "mode": {"parallel": true,"type": "integrated"},
> "registration": "none",
> "source": {"name": "ed"},
> "status": "running"
> }' \
> | json_reformat
{
    "$schema": "api:standardResponse",
    "links": [
        {
            "rel": "canonical",
            "href": "http://localhost:9011/services/v2/replicats/RDEMO",
            "mediaType": "application/json"
        },
        {
            "rel": "self",
            "href": "http://localhost:9011/services/v2/replicats/RDEMO",
            "mediaType": "application/json"
        }
    ],
    "messages": [
        {
            "$schema": "ogg:message",
            "title": "Parallel Replicat added.",
            "code": "OGG-08100",
            "severity": "INFO",
            "issued": "2021-10-14T02:37:54Z",
            "type": "http://docs.oracle.com/goldengate/c2130/gg-winux/GMESG/oggus.htm#OGG-08100"
        },
        {
            "$schema": "ogg:message",
            "title": "Parameter file RDEMO.prm passed validity check.",
            "code": "OGG-10183",
            "severity": "INFO",
            "issued": "2021-10-14T02:37:54Z",
            "type": "http://docs.oracle.com/goldengate/c2130/gg-winux/GMESG/oggus.htm#OGG-10183"
        },
        {
            "$schema": "ogg:message",
            "title": "Replicat group RDEMO starting.",
            "code": "OGG-00975",
            "severity": "INFO",
            "issued": "2021-10-14T02:37:54Z",
            "type": "http://docs.oracle.com/goldengate/c2130/gg-winux/GMESG/oggus.htm#OGG-00975"
        },
        {
            "$schema": "ogg:message",
            "title": "Replicat group RDEMO started.",
            "code": "OGG-15445",
            "severity": "INFO",
            "issued": "2021-10-14T02:37:54Z",
            "type": "http://docs.oracle.com/goldengate/c2130/gg-winux/GMESG/oggus.htm#OGG-15445"
        }
    ]
}

Here are the options to stop, start de delete the replicat

— Delete Replicat
curl -s -u oggadmin:”xxxx” \
-H “Content-Type: application/json” \
-H “Accept: application/json” \
-X DELETE http://localhost:9011/services/v2/replicats/RDEMO | json_reformat

— Start Replicat
curl -s -u oggadmin:”xxxx” \
-H “Content-Type: application/json” \
-H “Accept: application/json” \
-X PATCH http://localhost:9011/services/v2/replicats/RDEMO \
-d ‘{“status”: “running”}’ | json_reformat

— Stop Replicat
curl -s -u oggadmin:”xxxx” \
-H “Content-Type: application/json” \
-H “Accept: application/json” \
-X PATCH http://localhost:9011/services/v2/replicats/RDEMO \
-d ‘{“status”: “stopped”}’ | json_reformat

and Last we can check the status.

-bash-4.2$ -- List Status, LAG and etc for a specific Extract
-bash: --: command not found
-bash-4.2$ curl -s -u oggadmin:"xxxx" \
> -H "Content-Type: application/json" \
> -H "Accept: application/json" \
> -X GET http://localhost:9011/services/v2/replicats/RDEMO/info/status | json_reformat
{
    "$schema": "api:standardResponse",
    "links": [
        {
            "rel": "canonical",
            "href": "http://localhost:9011/services/v2/replicats/RDEMO/info/status",
            "mediaType": "application/json"
        },
        {
            "rel": "self",
            "href": "http://localhost:9011/services/v2/replicats/RDEMO/info/status",
            "mediaType": "application/json"
        },
        {
            "rel": "describedby",
            "href": "http://localhost:9011/services/v2/metadata-catalog/replicatStatus",
            "mediaType": "application/schema+json"
        }
    ],
    "messages": [

    ],
    "response": {
        "$schema": "ogg:replicatStatus",
        "status": "running",
        "processId": 11012,
        "lastStarted": "2021-10-14T02:42:18.914Z",
        "lag": 0,
        "sinceLagReported": 1,
        "position": {
            "path": "/u02/trails/",
            "name": "ed",
            "sequence": 2,
            "offset": 1348
        }
    }
}
-bash-4.2$

We can check the same from the GUI:

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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