Oracle GoldenGate Services Architecture: Configure Deployment Via REST API

Introduction

The Oracle GoldenGate Microservices Architecture (OGG-SA) REST API may be used to configure Extracts, Replicats, and Distribution Paths, as well as create new parameter files or modify existing ones for a Deployment. In this article we shall use the REST API to configure a replication path and perform common modifications to Deployments; such as changing OGG_HOME after an OGG-SA upgrade.

The concepts, scripts, and information presented in this article are for educational purposes only. They are not supported by Oracle Development or Support, and come with no guarantee or warrant for functionality in any environment other than the test system used to prepare this article. Before applying any changes presented in this article to your environment, you should thoroughly test to assess functionality and performance implications.

Main Article

OGG-SA REST API commands are sent to the Administration Server, Services Manager, Distribution Server, Receiver Server, and Performance Metrics Server via the cURL command line tool. cURL (shorthand for Client Uniform Resource Locator) is a library and command line tool for transferring data between a server and the client using the URL syntax. A version of cURL that supports SSL must be installed on the client in order to utilize OGG-SA REST API functions.

The following example curl command will retrieve a listing of all parameter files for an OGG-SA deployment on my virtual server ora12nomt and associated with the OGG-SA Admin Server running on port 17010:

curl -u oracle:Oracle1 -k \
-H “Content-Type: application/json” \
-H “Accept: application/json” \
-X GET https://ora12nomt:17010/services/v2/config/files

Because the ora12nomt server is a virtual machine in a test environment, it uses a self-signed SSL certificate; therefore, I must use the -k cURL option to disable certificate validation. The “\” characters allow me to split the curl command across multiple lines, making it easier to read.

The response shows there is only one parameter file, GLOBALS, which was created as part of the deployment creation process.

{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://ora12nomt:17010/services/v2/config/files”,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://ora12nomt:17010/services/v2/config/files”,”mediaType”:”application/json”,”rel”:”self”},{“href”:”https://ora12nomt:17010/services/v2/metadata-catalog/files”,”mediaType”:”application/schema+json”,”rel”:”describedby”}],”messages”:[],”response”:{“$schema”:”ogg:collection”,”items”:[{“$schema”:”ogg:collectionItem”,”links”:[{“href”:”https://ora12nomt:17010/services/v2/config/files”,”mediaType”:”application/json”,”rel”:”parent”},{“href”:”https://ora12nomt:17010/services/v2/config/files/GLOBALS”,”mediaType”:”application/json”,”rel”:”canonical”}],”name”:”GLOBALS“}]}}

Since our curl call works, we can start configuring the deployment.

Credentials

An alias for the Oracle GoldenGate database user credentials for Integrated Extract (source only) and Replicat (target only) must be created in the deployment Credential Store. (This article assumes the source and target Oracle Database have been properly configured to allow Oracle GoldenGate Capture and Apply of data and that database credentials have been assigned for the Oracle GoldenGate application).

The curl command below will create the Credential Store alias ggalias for the default OracleGoldenGate Domain:

 curl -u oracle:Oracle1 -k \
-H “Content-Type: application/json” \
-H “Accept: application/json” \
-X POST https://ora12nomt:17010/services/v2/credentials/OracleGoldenGate/ggalias \
-d \
‘{
“userid”:”ggadmin”,
“password”:”Oracle1″
}’

The password “Oracle1” is not an acceptable database credential password and should never be used in your environment.

The response is somewhat misleading as it leads one to believe an error was encountered. In reality, the informational message was returned because the credential store was altered to add the new alias:

{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://ora12nomt:17010/services/v2/credentials/OracleGoldenGate/ggalias”,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://ora12nomt:17010/services/v2/credentials/OracleGoldenGate/ggalias”,”mediaType”:”application/json”,”rel”:”self”}],”messages”:[{“$schema”:”ogg:message”,”code”:”OGG-15114″,”issued”:”2018-10-29T12:40:15Z”,”severity”:”INFO”,”title”:”Credential store altered.”,”type”:”http://docs.oracle.com/goldengate/c1230/gg-winux/GMESG/oggus.htm#OGG-15114″},{“$schema”:”ogg:message”,”code”:”OGG-15116″,”issued”:”2018-10-29T12:40:15Z”,”severity”:”INFO”,”title”:”No information found in credential store.”,”type”:”http://docs.oracle.com/goldengate/c1230/gg-winux/GMESG/oggus.htm#OGG-15116″}]}

We can verify the alias exists by querying the credential store:

curl -u oracle:Oracle1 -k \
-H “Content-Type: application/json” \
-H “Accept: application/json” \
-X GET https://ora12nomt:17010/services/v2/credentials/OracleGoldenGate/ggalias

The response returns the userid stored:

{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://ora12nomt:17010/services/v2/credentials/OracleGoldenGate/ggalias”,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://ora12nomt:17010/services/v2/credentials/OracleGoldenGate/ggalias”,”mediaType”:”application/json”,”rel”:”self”},{“href”:”https://ora12nomt:17010/services/v2/metadata-catalog/alias”,”mediaType”:”application/schema+json”,”rel”:”describedby”}],”messages”:[],”response”:{“$schema”:”ogg:credentials”,”userid”:”ggadmin“}}

Now that we have our Credential Store setup, we can setup Extracts and Replicats.

Integrated Extract

The following curl command will create an Integrated Extract named EBNYPOS, the associated parameter file will be created with the settings provided in the “config” array, the Extract will be registered with the database, and its associated the EXTTRAIL will be added to the instance:

curl -u oracle:Oracle1 -k \
-H “Content-Type: application/json” \
-H “Accept: application/json” \
-X POST https://ora12nomt:17010/services/v2/extracts/EBNYPOS \
-d \
‘{
“config”:[“extract ebnypos”,”exttrail eb”,”useridalias ggalias”,”table bunnypos.*;”],
“source”:{“tranlogs”:”integrated”},
“credentials”:{“alias”:”ggalias”},
“registration”:”default”,
“begin”:”now”,
“targets”:[{“name”:”eb”}]
}’

The response shows the Integrated Extract and EXTTRAIL have been added:

{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://ora12nomt:17010/services/v2/extracts/EBNYPOS”,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://ora12nomt:17010/services/v2/extracts/EBNYPOS”,”mediaType”:”application/json”,”rel”:”self”}],”messages”:[{“$schema”:”ogg:message”,”code”:”OGG-08100″,”issued”:”2018-10-25T16:52:37Z”,”severity”:”INFO”,”title”:”EXTRACT (Integrated) added.”,”type”:”http://docs.oracle.com/goldengate/c1230/gg-winux/GMESG/oggus.htm#OGG-08100″},{“$schema”:”ogg:message”,”code”:”OGG-02003″,”issued”:”2018-10-25T16:52:48Z”,”severity”:”INFO”,”title”:”Extract EBNYPOS successfully registered with database at SCN 3239426.”,”type”:”http://docs.oracle.com/goldengate/c1230/gg-winux/GMESG/oggus.htm#OGG-02003″},{“$schema”:”ogg:message”,”code”:”OGG-08100″,”issued”:”2018-10-25T16:52:48Z”,”severity”:”INFO”,”title”:”EXTTRAIL added.”,”type”:”http://docs.oracle.com/goldengate/c1230/gg-winux/GMESG/oggus.htm#OGG-08100″}]}

We can query the deployment to show the Integrated Extract details:

curl -u oracle:Oracle1 -k \
-H “Content-Type: application/json” \
-H “Accept: application/json” \
-X GET https://ora12nomt:17010/services/v2/extracts/EBNYPOS
{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://ora12nomt:17010/services/v2/extracts/EBNYPOS”,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://ora12nomt:17010/services/v2/extracts/EBNYPOS”,”mediaType”:”application/json”,”rel”:”self”},{“href”:”https://ora12nomt:17010/services/v2/metadata-catalog/extract”,”mediaType”:”application/schema+json”,”rel”:”describedby”}],”messages”:[],”response”:{“$schema”:”ogg:extract”,”begin”:”now”,”config”:[“extract ebnypos”,”exttrail eb”,”useridalias ggalias”,”table bunnypos.*;”],”credentials”:{“alias”:”ggalias”},”registration”:{“csn”:3270609},”source”:{“tranlogs”:”integrated”},”status”:”stopped“,”targets”:[{“name”:”eb”,”offset”:0,”remote”:false,”sequence”:0,”sequenceLength”:6,”sequenceLengthFlip”:true,”sizeMB”:500}]}}

To start the EBNYPOS Integrated Extract issue the command (or I could have added the option “status”:”running” to the previous command where I created the Integrated Extract):

curl -u oracle:Oracle1 -k \
-H “Content-Type: application/json” \
-H “Accept: application/json” \
-X POST https://ora12nomt:17010/services/v2/commands/execute \
-d \
‘{
“processName”:”EBNYPOS”,
“name”:”start”
}’

Response:

{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://ora12nomt:17010/services/v2/commands/execute”,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://ora12nomt:17010/services/v2/commands/execute”,”mediaType”:”application/json”,”rel”:”self”}],”messages”:[{“$schema”:”ogg:message”,”code”:”OGG-00975″,”issued”:”2018-10-25T18:02:14Z”,”severity”:”INFO”,”title”:”EXTRACT EBNYPOS starting”,”type”:”http://docs.oracle.com/goldengate/c1230/gg-winux/GMESG/oggus.htm#OGG-00975″},{“$schema”:”ogg:message”,”code”:”OGG-15426″,”issued”:”2018-10-25T18:02:14Z”,”severity”:”INFO”,”title”:”EXTRACT EBNYPOS started“,”type”:”http://docs.oracle.com/goldengate/c1230/gg-winux/GMESG/oggus.htm#OGG-15426″}]}

Then we can obtain status information again:

curl -u oracle:Oracle1 -k \
  -H “Content-Type: application/json” \
  -H “Accept: application/json” \
  -X GET https://ora12nomt:17010/services/v2/extracts/EBNYPOS
{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://ora12nomt:17010/services/v2/extracts/EBNYPOS”,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://ora12nomt:17010/services/v2/extracts/EBNYPOS”,”mediaType”:”application/json”,”rel”:”self”},{“href”:”https://ora12nomt:17010/services/v2/metadata-catalog/extract”,”mediaType”:”application/schema+json”,”rel”:”describedby”}],”messages”:[],”response”:{“$schema”:”ogg:extract”,”begin”:”now”,”config”:[“extract ebnypos”,”exttrail eb”,”useridalias ggalias”,”table bunnypos.*;”],”credentials”:{“alias”:”ggalias”},”registration”:{“csn”:3270609},”source”:{“tranlogs”:”integrated”},“status”:”running”,”targets”:[{“name”:”eb”,”offset”:5344,”remote”:false,”sequence”:2,”sequenceLength”:9,”sequenceLengthFlip”:false,”sizeMB”:500}]}}

Distribution Paths

We can create Distribution Paths to move the eb Extract Trail to downstream Oracle GoldenGate Classic instances and Microservices Deployments. The following command creates a path to the Oracle GoldenGate Classic instance running on the server oggbd123, delivering data to the target Trail ./dirdat/pa.

curl -u oracle:Oracle1 -k \
-H “Content-Type: application/json” \
-H “Accept: application/json” \
-X POST https://ora12nomt:17011/services/v2/sources/oggbd123_pth1 \
-d \
‘{
“$schema”:”ogg:distPath”,
“name”:”oggbd123_pth1″,
“description”:”DistPath to OGG-BD Classic”,
“source”:{“uri”:”trail://ora12nomt:17011/services/v2/sources?trail=eb”},
“target”:{“uri”:”ogg://oggdb123:16000/services/v2/targets?trail=./dirdat/pa”},
“begin”:{“sequence”:0,”offset”:0},
“status”:”running”
}’

The response shows the Path being added:

{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://ora12nomt:17011/services/v2/sources/oggbd123_pth1″,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://ora12nomt:17011/services/v2/sources/oggbd123_pth1″,”mediaType”:”application/json”,”rel”:”self”}],”messages”:[{“$schema”:”ogg:message”,”code”:”OGG-08511″,”issued”:”2018-10-29T15:47:36Z”,”severity”:”INFO”,”title”:”The path ‘oggbd123_pth1’ has been added.”,”type”:”http://docs.oracle.com/goldengate/c1230/gg-winux/GMESG/oggus.htm#OGG-08511″}]}

Querying the Distribution Path shows it is running:

curl -u oracle:Oracle1 -k -H “Content-Type: application/json” -H “Accept: application/json” -X GET https://ora12nomt:17011/services/v2/sources/oggbd123_pth1
{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://ora12nomt:17011/services/v2/sources/oggbd123_pth1″,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://ora12nomt:17011/services/v2/sources/oggbd123_pth1″,”mediaType”:”application/json”,”rel”:”self”},{“href”:”https://ora12nomt:17011/services/v2/metadata-catalog/distpath”,”mediaType”:”application/schema+json”,”rel”:”describedby”}],”messages”:[],”response”:{“$schema”:”ogg:distPath”,”begin”:{“offset”:0,”sequence”:0},”description”:”DistPath to OGG-BD Classic”,”name”:”oggbd123_pth1″,”source”:{“uri”:”trail://ora12nomt:17011/services/v2/sources?trail=eb”},”status”:”running“,”target”:{“uri”:”ogg://oggdb123:16000/services/v2/targets?trail=./dirdat/pa”}}}

To create a WSS Path between my secure ora12nomt deployment and a secure deployment on the server centosora12, I first copy my Distribution Server Wallet created and used for the secure source server deployment to the location [deployment name]/etc/ssl on the target server. Then we can run the following command to create the secure Distribution Path:

curl -u oracle:Oracle1 -k \
-H “Content-Type: application/json” \
-H “Accept: application/json” \
-X POST https://ora12nomt:17011/services/v2/sources/centosora12_pth1 \
-d \
‘{
“$schema”:”ogg:distPath”,
“name”:”centosora12_pth1″,
“description”:”Secure DistPath to OGG-MA at centosora12″,
“source”:{“uri”:”trail://ora12nomt:17011/services/v2/sources?trail=eb”},
“target”:{“uri”:”wss://centosora12:17103/services/v2/targets?trail=rb”},
“status”:”running”
}’

WSS Paths may only be configured between (1) two secure deployments or (2) and insecure source and a secure target when the source deployment was created with the option “this non-secure deployment will be used to send trail data to a secure deployment”. For secure source to insecure target Paths you may use OGG, UDT, or WS.

The response shows the path has been added:

{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://ora12nomt:17011/services/v2/sources/centosora12_pth1″,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://ora12nomt:17011/services/v2/sources/centosora12_pth1″,”mediaType”:”application/json”,”rel”:”self”}],”messages”:[{“$schema”:”ogg:message”,”code”:”OGG-08511″,”issued”:”2018-10-29T17:21:49Z”,”severity”:”INFO”,”title”:”The path ‘centosora12_pth1’ has been added.”,”type”:”http://docs.oracle.com/goldengate/c1230/gg-winux/GMESG/oggus.htm#OGG-08511″}]}

Querying the Distribution Path shows that it is running:

curl -u oracle:Oracle1 -k \
 -H “Content-Type: application/json” \
 -H “Accept: application/json” \
 -X GET https://ora12nomt:17011/services/v2/sources/centosora12_pth1
{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://ora12nomt:17011/services/v2/sources/centosora12_pth1″,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://ora12nomt:17011/services/v2/sources/centosora12_pth1″,”mediaType”:”application/json”,”rel”:”self”},{“href”:”https://ora12nomt:17011/services/v2/metadata-catalog/distpath”,”mediaType”:”application/schema+json”,”rel”:”describedby”}],”messages”:[],”response”:{“$schema”:”ogg:distPath”,”description”:”Secure DistPath to OGG-MA at centosora12″,”name”:”centosora12_pth1″,”source”:{“uri”:”trail://ora12nomt:17011/services/v2/sources?trail=eb”},”status”:”running“,”target”:{“uri”:”wss://centosora12:17103/services/v2/targets?trail=rb”}}}

Replicat

OGG-SA supports Classic Replicat, Integrated Replicat, Coordinated Replicat, Parallel Replicat, and Initial Load Replicat. To add a Parallel Replicat to my target deployment and complete the replication stream, I would use the following curl commands:

(1) Add the Replicat database user credentials to the Credential Store:

curl -u oracle:Oracle1 -k \
 -H “Content-Type: application/json” \
 -H “Accept: application/json” \
 -X POST https://centosOra12:17101/services/v2/credentials/OracleGoldenGate/repnoreast \
 -d \
 ‘{
 “userid”:”ggadmin@pdbnoreast”,
 “password”:”Oracle1″
 }’
{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://centosOra12:17101/services/v2/credentials/OracleGoldenGate/repnoreast”,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://centosOra12:17101/services/v2/credentials/OracleGoldenGate/repnoreast”,”mediaType”:”application/json”,”rel”:”self”}],”messages”:[{“$schema”:”ogg:message”,”code”:”OGG-15114″,”issued”:”2018-10-29T18:44:57Z”,”severity”:”INFO”,”title”:”Credential store altered.”,”type”:”http://docs.oracle.com/goldengate/c1230/gg-winux/GMESG/oggus.htm#OGG-15114″},{“$schema”:”ogg:message”,”code”:”OGG-15116″,”issued”:”2018-10-29T18:44:57Z”,”severity”:”INFO”,”title”:”No information found in credential store.”,”type”:”http://docs.oracle.com/goldengate/c1230/gg-winux/GMESG/oggus.htm#OGG-15116″}]}

(2) Create the Parallel Replicat and parameter file, and start it:

curl -u oracle:Oracle1 -k \
-H “Content-Type: application/json” \
-H “Accept: application/json” \
-X POST https://centosOra12:17101/services/v2/replicats/RBNY \
-d \
‘{
“$schema”:”ogg:replicat”,
“checkpoint”:{“table”:”PDBNOREAST.GGADMIN.GGCHKPT”},
“config”:[“replicat rbny”,”useridalias repnoreast domain OracleGoldenGate”,”reportcount every 10 minutes, rate”,”report at 00:01″,”MAP_PARALLELISM 2″,”MIN_APPLY_PARALLELISM 2″,”MAX_APPLY_PARALLELISM 10″,”SPLIT_TRANS_RECS 10000″,”MAP *.*, TARGET *.*;”],
“credentials”:{“alias”:”repnoreast”,”domain”:”OracleGoldenGate”},
“description”:”Parallel Apply BNYPOS at ora12nomt to pdbnoreast”,
“mode”:{“parallel”:true,”type”:”nonintegrated”},
“source”:{“name”:”rb”},
“status”:”running”
}’

Response:

{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://centosOra12:17101/services/v2/replicats/RBNY”,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://centosOra12:17101/services/v2/replicats/RBNY”,”mediaType”:”application/json”,”rel”:”self”}],”messages”:[{“$schema”:”ogg:message”,”code”:”OGG-08100″,”issued”:”2018-10-29T19:10:29Z”,”severity”:”INFO”,”title”:”REPLICAT (Parallel) added.”,”type”:”http://docs.oracle.com/goldengate/c1230/gg-winux/GMESG/oggus.htm#OGG-08100″},{“$schema”:”ogg:message”,”code”:”OGG-00975″,”issued”:”2018-10-29T19:10:31Z”,”severity”:”INFO”,”title”:”REPLICAT RBNY starting“,”type”:”http://docs.oracle.com/goldengate/c1230/gg-winux/GMESG/oggus.htm#OGG-00975″}]}

Verify the Replicat is running:

curl -u oracle:Oracle1 -k \
 -H “Content-Type: application/json” \
 -H “Accept: application/json” \
 -X GET https://centosOra12:17101/services/v2/replicats/RBNY/info/status
{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://centosOra12:17101/services/v2/replicats/RBNY/info/status”,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://centosOra12:17101/services/v2/replicats/RBNY/info/status”,”mediaType”:”application/json”,”rel”:”self”},{“href”:”https://centosOra12:17101/services/v2/metadata-catalog/replicatStatus”,”mediaType”:”application/schema+json”,”rel”:”describedby”}],”messages”:[],”response”:{“$schema”:”ogg:replicatStatus”,”lag”:0,”lastStarted”:”2018-10-29T19:10:31.594Z”,”position”:{“name”:”rb”,”offset”:105678,”path”:”/u01/oracle/app/goldengate/deployments/centosora12/var/lib/data”,”sequence”:0},”processId”:14717,”sinceLagReported”:6,”status”:”running“}}

Modify Existing Settings

The REST API may also be used to make modifications to the environment.

Update Deployments

The Service Manager may be queried to retrieve details about my ora12nomt Deployment:

curl -u oracle:Oracle1 -k \
-H “Content-Type: application/json” \
-H “Accept: application/json” \
-X GET https://ora12nomt:17000/services/v2/deployments/ora12nomt

The response returns details about the employment environment, settings, and status:

{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://ora12nomt:17000/services/v2/deployments/ora12nomt”,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://ora12nomt:17000/services/v2/deployments/ora12nomt”,”mediaType”:”application/json”,”rel”:”self”},{“href”:”https://ora12nomt:17000/services/v2/metadata-catalog/deployment”,”mediaType”:”application/schema+json”,”rel”:”describedby”}],”messages”:[],”response”:{“$schema”:”ogg:deployment”,”enabled”:true,”environment”:[{“name”:”ORACLE_SID”,”value”:”orcl”},{“name”:”LD_LIBRARY_PATH”,”value”:”/u01/oracle/app/goldengate/ogg123ma/lib:/u01/oracle/app/goldengate/ogg123ma/install/lib:/u01/oracle/app/goldengate/ogg123ma/oui/lib/linux64:/u01/oracle/app/oracle/product/12.1.0/dbhome_1/lib”},{“name”:”JAVA_HOME”,”value”:”/u01/oracle/app/goldengate/ogg123ma/jdk”},{“name”:”ORACLE_HOME”,”value”:”/u01/oracle/app/oracle/product/12.1.0/dbhome_1″},{“name”:”TNS_ADMIN”,”value”:”/u01/oracle/app/oracle/product/12.1.0/dbhome_1/network/admin”}],”oggConfHome”:”/u01/oracle/app/goldengate/deployments/ora12nomt/etc/conf”,”oggDataHome”:”/u01/oracle/app/goldengate/deployments/ora12nomt/var/lib/data”,”oggEtcHome”:”/u01/oracle/app/goldengate/deployments/ora12nomt/etc”,”oggHome”:”/u01/oracle/app/goldengate/ogg123ma”,”oggSslHome”:”/u01/oracle/app/goldengate/deployments/ora12nomt/etc/ssl”,”oggVarHome”:”/u01/oracle/app/goldengate/deployments/ora12nomt/var”,”status”:”running“}}

Two common maintenance tasks for Deployments are: (1) updating the OGG_HOME location and LD_LIBRARY_PATH settings after performing an OGG-SA upgrade, and (2) updating the ORACLE_HOME, TNS_ADMIN, and LD_LIBRARY_PATH settings if they change as part of database maintenance tasks.

To update OGG_HOME and LD_LIBRARY_PATH, and restart the Deployment:

curl -u oracle:Oracle1 -k \
-H “Content-Type: application/json” \
-H “Accept: application/json” \
-X PATCH https://ora12nomt:17000/services/v2/deployments/ora12nomt \
-d \
‘{
“$schema”:”ogg:deployment”,
“oggHome”:”/u01/oracle/app/goldengate/ogg18ma”,
“environment”:[{“name”:”ORACLE_SID”,”value”:”orcl”},{“name”:”LD_LIBRARY_PATH”,”value”:”/u01/oracle/app/goldengate/ogg18ma/lib:/u01/oracle/app/goldengate/ogg18ma/install/lib:/u01/oracle/app/goldengate/ogg18ma/oui/lib/linux64:/u01/oracle/app/oracle/product/12.1.0/dbhome_1/lib”},{“name”:”JAVA_HOME”,”value”:”/u01/oracle/app/goldengate/ogg18ma/jdk”},{“name”:”ORACLE_HOME”,”value”:”/u01/oracle/app/oracle/product/12.1.0/dbhome_1″},{“name”:”TNS_ADMIN”,”value”:”/u01/oracle/app/oracle/product/12.1.0/dbhome_1/network/admin”}],
“status”:”restart”
}’

Response:

{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://ora12nomt:17000/services/v2/deployments/ora12nomt”,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://ora12nomt:17000/services/v2/deployments/ora12nomt”,”mediaType”:”application/json”,”rel”:”self”}],”messages”:[]}

Rerunning the query to obtain Deployment information again, we see:

curl -u oracle:Oracle1 -k \
 -H “Content-Type: application/json” \
 -H “Accept: application/json” \
 -X GET https://ora12nomt:17000/services/v2/deployments/ora12nomt
{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://ora12nomt:17000/services/v2/deployments/ora12nomt”,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://ora12nomt:17000/services/v2/deployments/ora12nomt”,”mediaType”:”application/json”,”rel”:”self”},{“href”:”https://ora12nomt:17000/services/v2/metadata-catalog/deployment”,”mediaType”:”application/schema+json”,”rel”:”describedby”}],”messages”:[],”response”:{“$schema”:”ogg:deployment”,”enabled”:true,”environment”:[{“name”:”ORACLE_SID”,”value”:”orcl”},{“name”:”LD_LIBRARY_PATH”,”value”:”/u01/oracle/app/goldengate/ogg18ma/lib:/u01/oracle/app/goldengate/ogg18ma/install/lib:/u01/oracle/app/goldengate/ogg18ma/oui/lib/linux64:/u01/oracle/app/oracle/product/12.1.0/dbhome_1/lib”},{“name”:”JAVA_HOME”,”value”:”/u01/oracle/app/goldengate/ogg18ma/jdk”},{“name”:”ORACLE_HOME”,”value”:”/u01/oracle/app/oracle/product/12.1.0/dbhome_1″},{“name”:”TNS_ADMIN”,”value”:”/u01/oracle/app/oracle/product/12.1.0/dbhome_1/network/admin”}],”oggConfHome”:”/u01/oracle/app/goldengate/deployments/ora12nomt/etc/conf”,”oggDataHome”:”/u01/oracle/app/goldengate/deployments/ora12nomt/var/lib/data”,”oggEtcHome”:”/u01/oracle/app/goldengate/deployments/ora12nomt/etc”,”oggHome”:”/u01/oracle/app/goldengate/ogg18ma“,”oggSslHome”:”/u01/oracle/app/goldengate/deployments/ora12nomt/etc/ssl”,”oggVarHome”:”/u01/oracle/app/goldengate/deployments/ora12nomt/var”,”status”:”running“}}

Extract/Replicat Parameter Files

Previously we created an Integrated Extract with the following runtime parameter settings:

“config”:[“extract ebnypos”,”exttrail eb”,”useridalias ggalias”,”table bunnypos.*;”]

The following cURL command will update the Integrated Extract parameters and restart the process:

curl -u oracle:Oracle1 -k \
-H “Content-Type: application/json” \
-H “Accept: application/json” \
-X PATCH https://ora12nomt:17010/services/v2/extracts/EBNYPOS \
-d \
‘{
“config”:[“extract ebnypos”,”exttrail eb”,”useridalias ggalias”,”reportcount every 10 minutes, rate”,”report at 00:01″,”reportrollover at 00:01 on sunday”,”warnlongtrans 1h, checkinterval 30m”,”table bunnypos.*;”,”table tpc.orders;”],
“status”:”running”
}’

 Response

{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://ora12nomt:17010/services/v2/extracts/EBNYPOS”,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://ora12nomt:17010/services/v2/extracts/EBNYPOS”,”mediaType”:”application/json”,”rel”:”self”}],”messages”:[{“$schema”:”ogg:message”,”code”:”OGG-00975″,”issued”:”2018-10-30T13:33:06Z”,”severity”:”INFO”,”title”:”EXTRACT EBNYPOS starting“,”type”:”http://docs.oracle.com/goldengate/c1230/gg-winux/GMESG/oggus.htm#OGG-00975″}]}

Get the Integrated Extract details:

curl -u oracle:Oracle1 -k \
 -H “Content-Type: application/json” \
 -H “Accept: application/json” \
 -X GET https://ora12nomt:17010/services/v2/extracts/EBNYPOS
{“$schema”:”api:standardResponse”,”links”:[{“href”:”https://ora12nomt:17010/services/v2/extracts/EBNYPOS”,”mediaType”:”application/json”,”rel”:”canonical”},{“href”:”https://ora12nomt:17010/services/v2/extracts/EBNYPOS”,”mediaType”:”application/json”,”rel”:”self”},{“href”:”https://ora12nomt:17010/services/v2/metadata-catalog/extract”,”mediaType”:”application/schema+json”,”rel”:”describedby”}],”messages”:[],”response”:{“$schema”:”ogg:extract”,”begin”:”now”,”config”:[“extract ebnypos”,”exttrail eb”,”useridalias ggalias”,”reportcount every 10 minutes, rate”,”report at 00:01″,”reportrollover at 00:01 on sunday”,”warnlongtrans 1h, checkinterval 30m”,”table bunnypos.*;”,”table tpc.orders;”],”credentials”:{“alias”:”ggalias”},”registration”:{“csn”:3270609},”source”:{“tranlogs”:”integrated”},”status”:”running“,”targets”:[{“name”:”eb”,”offset”:406362,”remote”:false,”sequence”:3,”sequenceLength”:9,”sequenceLengthFlip”:false,”sizeMB”:500}]}}

 

Summary

In this article we used cURL and the Oracle GoldenGate Microservices Architecture REST API to configure a replication stream  consisting of Integrated Extract, Distribution Path, and Parallel Replicat, modified my Deployment settings after performing an OGG-SA source code upgrade, and modified my Integrated Extract parameter settings.

For more information on what other articles are available for Oracle GoldenGate please view our index page.

Add Your Comment