Updating parameter files from REST
One of the most important and time consuming things to do with Oracle GoldenGate is to build parameter files for the GoldenGate processes. In the past, this required you to access GGSCI and run commands like:
GGSCI> edit params <process group>
After which, you then had to bounce the process group for the changes to take effect. This process has improved a good bit and can be a bit more dynamic in my opinion.
In a previous post (here), I showed you have to build an Extract using the associated REST API end-point and JSON. Being able to build extracts/replicats by using a REST API and JSON is a huge step forward with how administration of the Oracle GoldenGate environment is done. In this post, I want to show you how quickly you can update your parameter files by using REST API and JSON.
Note: I’m assuming you have some basic understand of how cURL works. If not, refer to a tutorial that can be easily found on the internet.
The first thing you need to do is fine the contents of the parameter file for the extract/replicat. Depending on your environment, this would be found in $DEPLOYMENT_HOME/etc/conf/ogg.
When you look at the above image, you can see that I have a few parameter files. If I was to do a cat on the the IEXTTPC.prm file, you would see contents like:
extract IEXTTPC
useridalias CGGATE domain OracleGoldenGate
exttrail zz
sourcecatalog oggtst1
table tpc.categories;
table tpc.categories_descriptions;
table tpc.customers;
table tpc.customers_info;
table tpc.customers_lkup;
table tpc.next_cust;
table tpc.next_order;
table tpc.orders;
table tpc.orders_products;
table tpc.orders_status_history;
table tpc.orders_total;
table tpc.products;
table tpc.products_description;
table tpc.prodcts_to_categories;
The contents of this parameter file is quite simple.
Let’s take the example of the requirement to add a new table to the parameter file. This table is called blc.totals. This table needs to be added to the bottom of the parameter file. In the traditional process, I would have to access AdminClient and perform an edit params IEXTTPC; however, you want to do this without touching the server.
The process to do this would be to use the Update (PATCH) cURL commands to modify the parameter file. For more information on how to patch option, you can refer to GoldenGate REST API documentation (here).
What you nee to look at in the documentation, is the body section. Within the body section, the config option. This is an optional array parameter that takes text strings into the configuration. The end result of what the contents of the parameter would look like:
{
"config":[
"extract IEXTTPC",
"useridalias CGGATE domain OracleGoldenGate",
"exttrail zz",
"sourcecatalog oggtst1",
"table tpc.categories;",
"table tpc.categories_descriptions;",
"table tpc.customers;",
"table tpc.customers_info;",
"table tpc.customers_lkup;",
"table tpc.next_cust;",
"table tpc.next_order;",
"table tpc.orders;",
"table tpc.orders_products;",
"table tpc.orders_status_history;",
"table tpc.orders_total;",
"table tpc.products;",
"table tpc.products_description;",
"table tpc.prodcts_to_categories;”,
“table blc.totals;"
]
}
Notice that we are just taking all the contents of the parameter file and adding the table that needs to be added to the bottom. Now you can use this JSON block to update the parameter file. The cURL command to update the parameter file would look something similar to this:
curl --request PATCH \
--url https://localhost:16001/services/v2/extracts/IEXTTPC \
--header 'authorization: Basic b2dnYWRtaW46V0VsY29tZTEyMzQ1IyM=' \
--data '{
"config":[
"extract IEXTTPC",
"useridalias CGGATE domain OracleGoldenGate",
"exttrail zz",
"sourcecatalog oggtst1",
"table tpc.categories;",
"table tpc.categories_descriptions;",
"table tpc.customers;",
"table tpc.customers_info;",
"table tpc.customers_lkup;",
"table tpc.next_cust;",
"table tpc.next_order;",
"table tpc.orders;",
"table tpc.orders_products;",
"table tpc.orders_status_history;",
"table tpc.orders_total;",
"table tpc.products;",
"table tpc.products_description;",
"table tpc.prodcts_to_categories;”,
“table blc.totals;"
]
}'
After running the above cURL command, you will see a message output that says the parameter file passed validity check:
{
“$schema”: “api:standardResponse”,
“links”: [
{
“rel”: “canonical”,
“href”: “https://localhost:16001/services/v2/extracts/IEXTTPC”,
“mediaType”: “application/json”
},
{
“rel”: “self”,
“href”: “https://localhost:16001/services/v2/extracts/IEXTTPC”,
“mediaType”: “application/json”
}
],
“messages”: [
{
“$schema”: “ogg:message”,
“title”: “Parameter file IEXTTPC.prm: Validity check: PASS”,
“code”: “OGG-10183”,
“severity”: “INFO”,
“issued”: “2019-12-10T16:06:36Z”,
“type”: “http://docs.oracle.com/goldengate/c1910/gg-winux/GMESG/oggus.htm#OGG-10183”
}
]
}
As long as you have a successful message on the validity check the parameter file has been updated. This can be confirmed by going to and look at the parameter file by either the HTML5 web page or by reviewing the parameter file as identified earlier.
The only thing left to do after updating the parameter file is to restart the extract/replicat. This can be done manually or automated via the REST API call as well.
You should not be able to quickly modify your parameter files on the Oracle GoldenGate Microservices Architecture.
Enjoy!!!
Bobby Curtis
I’m Bobby Curtis and I’m just your normal average guy who has been working in the technology field for awhile (started when I was 18 with the US Army). The goal of this blog has changed a bit over the years. Initially, it was a general blog where I wrote thoughts down. Then it changed to focus on the Oracle Database, Oracle Enterprise Manager, and eventually Oracle GoldenGate.
If you want to follow me on a more timely manner, I can be followed on twitter at @dbasolved or on LinkedIn under “Bobby Curtis MBA”.
Hello! Quick question that’s entirely off topic. Do you know how
to make your site mobile friendly? My web site looks weird when viewing from my iphone 4.
I’m trying to find a template or plugin that might be able to resolve
this problem. If you have any recommendations, please share.
Thanks!
What’s up to all, how is everything, I think every one is getting more from this site, and your views
are nice for new viewers.
I am not sure where you are getting your info,
but good topic. I needs to spend some time learning more or understanding more.
Thanks for great information I was looking for this information for my mission.
Do you mind if I quote a few of your articles as long as
I provide credit and sources back to your weblog? My blog site is in the very same niche as yours and my visitors would truly benefit from some of the information you provide here.
Please let me know if this okay with you. Appreciate it!
Somebody essentially lend a hand to make significantly posts I might state.
This is the very first time I frequented your web page and up to now?
I surprised with the analysis you made to create
this actual put up incredible. Excellent activity!
Hello there, You’ve done a great job. I’ll certainly digg it and personally suggest to my friends.
I am sure they will be benefited from this website.
What’s Taking place i’m new to this, I stumbled
upon this I’ve discovered It absolutely helpful and it has aided me out loads.
I am hoping to give a contribution & assist different users like its aided me.
Good job.
Hello, this weekend is good in support of me, as this occasion i am reading
this impressive educational paragraph here at my home.
Good article. I am facing many of these issues as well..
I am not sure where you are getting your info, but great topic.
I needs to spend some time learning more or understanding more.
Thanks for fantastic info I was looking for this info
for my mission.
Visit my web page :: eharmony special coupon code 2025
You are so interesting! I do not suppose I’ve read through a single
thing like this before. So nice to discover another person with some unique
thoughts on this issue. Really.. many thanks for starting this up.
This web site is one thing that is needed on the
internet, someone with a little originality!
Hi! Someone in my Myspace group shared this site with us so I came to
take a look. I’m definitely enjoying the information.
I’m bookmarking and will be tweeting this to my followers!
Wonderful blog and terrific design.
I loved as much as you’ll receive carried out right here.
The sketch is attractive, your authored material
stylish. nonetheless, you command get bought an impatience over that you wish be delivering the following.
unwell unquestionably come more formerly again as exactly
the same nearly very often inside case you shield this hike.
Also visit my web site vpn
토닥이를 처음 이용하시는 분들도 걱정하지 않으셔도 됩니다.
아래와 같은 간단한 절차로 쉽게 예약하고 이용할 수 있습니다.
Sweet blog! I found it while searching on Yahoo News.
Do you have any tips on how to get listed in Yahoo News?
I’ve been trying for a while but I never seem to get there!
Appreciate it