Oracle #GoldenGate Replicate Apply (Run) Rate
For a couple of weeks now, I’ve been trying to figure out a way to identify the size of data for transactions that are getting processed over a give period of time with Oracle GoldenGate. When I started to think through the process, I keyed in on the Relative Byte Address (RBA). What is the RBA? From reading Oracle’s GoldenGate documentation, the RBA is mostly a marker within the trail file to identify the location of the transaction. This got me to thinking; maybe I can use the RBA to “estimate” the amount of data applied to the source over a period of time (compare 2 RBAs).
Before I ventured off in the unknown; I wanted to verify if there was a method already identified by Oracle. What I found in MOS was Note ID: 1356524.1. This note deals mostly with how to identify the speed of the extraction process. What I found interesting in this note is that Oracle is using the RBA to help calculate the amount of data being extracted. With this note in hand, I felt comfortable in using the RBA to “estimate” the amount of data being applied by a replicat.
Note: How to estimate Goldengate extract redo processing speed? (Doc ID 1356524.1)
A few sentences ago, I mentioned that I wanted to compare 2 RBAs to “estimate” the amount of data applied over a period of time. In order to do this, I need to convert the RBA into meaningful number.
The following formulas I used to convert the RBA to megabytes and then into the metrics I wanted:
(($sec_rba - $first_rba)/(1024*1024)) <- find the “estimated” size applied in MB ($mb_min*60) <- find the “estimate” size applied over an hour in MB ($mb_hr/(1024)) <- find the “estimate” size applied in GB for an hour ($gb_hr*24) <- find the “estimate” size for a day in GB
Now the question was how can I grab this information from each replicat. The information I needed could be found by doing a “info replicat <replicat>, detail” (The detail part is not really needed, just use it to list out all the associated trail files). The output from the info command looks similar to this:
Info Replicat Output:
The thing to keep in mind is that I’m only concern about two lines in this output. The first line is the “Log Read Checkpoint” and the second line that has the Date and RBA number. Now in order to gather this information and do the calculations using the RBA, I wrote a Perl script. The for this basics of the script are below:
#!/usr/bin/perl -w # #Author: Bobby Curtis, Oracle ACE #Copyright: 2014 #Title: gg_run_rate_from_rba.pl # use strict; use warnings; #Static Variables my $gghome = "/u01/app/oracle/product/12.1.2/ogg"; my $outfile = "/tmp/gg_replicat_runrates.txt"; my $sleeptime = 60; my $gguser = "c##ggate"; my $ggpass = "ggate"; my @process = ("replicat"); my $replicat; my($date1,$curtrail1,$rba1); my($date2,$curtrail2,$rba2); my($rate_min, $rate_hr, $rate_gb_hr, $rate_gb_day); #Program open (RUNRATES, ">>$outfile") or die "Unable to open file"; foreach my $i(@process) { my @process_name = `ps -ef | grep dirprm | grep $i | grep -v grep | awk '{print \$14}'`; my @replicats = @process_name; foreach (@replicats) { $replicat = $_; chomp($replicat); check_replicat($gguser, $ggpass, $replicat); ($curtrail1,$date1,$rba1) = check_replicat(); #print "$curtrail1 -> $date1 -> $rba1\n"; sleep($sleeptime); check_replicat($gguser, $ggpass, $replicat); ($curtrail2,$date2,$rba2) = check_replicat(); #print "$curtrail2 -> $date2 -> $rba2\n"; calc_rate($rba1,$rba2); ($rate_min, $rate_hr, $rate_gb_hr, $rate_gb_day) = calc_rate(); print RUNRATES "$replicat|$date1|$curtrail1|$rba1|$date2|$curtrail2|$rba2|$rate_min|$rate_hr|$rate_gb_hr|$rate_gb_day\n"; } } close (RUNRATES); ################# #Sub Programs ################# sub check_replicat { my @buf = `$gghome/ggsci << EOF dblogin userid $gguser\@pdb2 password $ggpass info replicat $replicat, detail EOF`; my $curtrail; my $date; my $rba; foreach (@buf) { if (/Log Read Checkpoint/) { if (m/(\.\/\w+\/\w+)/g) { $curtrail = $1; } } if (/RBA/) { if (m/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/g) { $date = $1."-".$2."-".$3." ".$4.":".$5.":".$6; } if (m/RBA (\d+)/g) { $rba = $1; } } } return($curtrail,$date,$rba); } #end sub check_replicat sub calc_rate { my $first_rba = $rba1; my $sec_rba = $rba2; my $mb_min = (($sec_rba-$first_rba)/(1024*1024)); my $mb_hr = ($mb_min*60); my $gb_hr = ($mb_hr/(1024)); my $gb_day = ($gb_hr*24); return ($mb_min,$mb_hr,$gb_hr, $gb_day); } #end sub calc_rate
This script is a bit longer than I like; however, it will capture all information required and then waits 60 seconds and gather the information again for the replicat it is working on. Once the first and second RBA are grabbed then the script writes the output to a flat file with the calculations for MB per min, MB per hour, GB per hour and GB per day.
Once the flat file has been written, I can now use an external table that will allow me to view this data from SQL (see my other post on monitoring GG from SQL..here). Using the external table, I can see what my run rates are from any SQL capable tool. Below is a simple query to pull the data from the external table.
Note: Some numbers in the output may be negative. This is due to the subtraction between RBA2 (smaller) and RBA1 (larger).
select repgroup as processgroup, to_char(date1, 'DD-MON-YY HH:MI:SS') snap1, curtrail1 as snap1_trail, rba1 as snap1_rba, to_char(date1, 'DD-MON-YY HH:MI:SS') snap2, curtrail2 as snap2_trail, rba2 as snap2_rba, rate_min_mb, rate_hr_mb, rate_hr_gb, rate_day_gb from gghb.replicat_runrates where repgroup = 'REP'; --Output (unformatted)-- PROCESSG SNAP1 SNAP1_TRAIL SNAP1_RBA SNAP2 SNAP2_TRAIL SNAP2_RBA RATE_MIN_MB RATE_HR_MB RATE_HR_GB RATE_DAY_GB -------- ------------------ ------------------------------ ---------- ------------------ ------------------------------ ---------- ----------- ---------- ---------- ----------- REP 22-MAY-14 01:38:51 ./dirdat/rt000034 2905346 22-MAY-14 01:38:51 ./dirdat/rt000034 3197702 286 17130 17 401 REP 22-MAY-14 01:39:49 ./dirdat/rt000034 3197702 22-MAY-14 01:39:49 ./dirdat/rt000034 3521610 316 18979 19 445 REP 22-MAY-14 01:40:50 ./dirdat/rt000034 3521610 22-MAY-14 01:40:50 ./dirdat/rt000034 3802260 274 16444 16 385 REP 22-MAY-14 01:41:49 ./dirdat/rt000034 3802260 22-MAY-14 01:41:49 ./dirdat/rt000034 4112529 303 18180 18 426 REP 22-MAY-14 01:42:49 ./dirdat/rt000034 4112529 22-MAY-14 01:42:49 ./dirdat/rt000034 4463477 343 20563 20 482
Being able to use an external table to view run rates additional scripts can be written to report on what is going on within the Oracle GoldenGate apply process. Allowing administrators a better understanding of what is going on within their environments. At the same time, I think this information is valuable in the turning process of Oracle GoldenGate as environment grown.
Let me know your thoughts and comments on this, because it is always interesting to see how other organizations solve these issues as well.
Enjoy!
twitter: @dbasolved
blog: http://dbasolved.com
Current Oracle Certs

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”.

This design is wicked! You obviously know how to keep a reader amused.
Between your wit and your videos, I was almost moved to start my
own blog (well, almost…HaHa!) Excellent job. I really loved what you had to say,
and more than that, how you presented it. Too cool!
I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.
These are in fact impressive ideas in regarding blogging. You have touched some pleasant things here.
Any way keep up wrinting.
It’s an awesome post for all the internet people;
they will get advantage from it I am sure.
It’s in fact very difficult in this active life to listen news on Television, therefore I just use the web for that reason, and take the latest news.
I was curious if you ever thought of changing the layout of your website?
Its very well written; I love what youve got to say.
But maybe you could a little more in the way of content so people could connect with it better.
Youve got an awful lot of text for only having 1
or 2 images. Maybe you could space it out
better?
I’d like to thank you for the efforts you’ve put in penning this site.
I’m hoping to view the same high-grade blog posts by
you later on as well. In truth, your creative writing abilities has motivated me to get my very own website now 😉
Hello there! Do you know if they make any plugins to protect
against hackers? I’m kinda paranoid about losing everything I’ve worked hard on.
Any recommendations?
I think the admin of this web page is really working hard in support of
his web site, since here every information is quality based material.
After I initially left a comment I seem to have clicked
on the -Notify me when new comments are added-
checkbox and from now on each time a comment is added I recieve 4 emails
with the same comment. Perhaps there is a way you are able to remove me from that service?
Thank you!
Howdy just wanted to give you a quick heads up. The words in your article seem to be running off the
screen in Safari. I’m not sure if this is a format
issue or something to do with browser compatibility but I thought I’d post
to let you know. The style and design look great though!
Hope you get the issue solved soon. Many thanks
Thanks a lot for sharing this with all of us you really recognise what you’re talking
about! Bookmarked. Kindly additionally visit my website =).
We can have a link exchange arrangement among us
Nice post. I learn something new and challenging
on websites I stumbleupon on a daily basis. It will always be exciting to read content from other writers and use something from
their websites.
You’ve made some decent points there. I looked on the web for additional information about the issue and found most
people will go along with your views on this website.
Hey! Would you mind if I share your blog with my twitter group?
There’s a lot of people that I think would really appreciate your content.
Please let me know. Cheers
Wow, this article is nice, my sister is analyzing such things, therefore I am going to tell her.
Hi, i believe that i saw you visited my weblog so i got here
to return the want?.I’m attempting to in finding things to improve my website!I guess its ok
to make use of a few of your ideas!!
Wow, superb blog layout! How long have you been blogging for?
you make blogging look easy. The overall look of your website is magnificent, as well
as the content!
Helpful information. Lucky me I found your web site accidentally, and I am stunned why this accident didn’t took place in advance!
I bookmarked it.
This page really has all the information and facts I needed
about this subject and didn’t know who to ask.
Hi are using WordPress for your blog platform?
I’m new to the blog world but I’m trying to get
started and create my own. Do you require any coding knowledge
to make your own blog? Any help would be greatly
appreciated!
I got this website from my friend who shared
with me about this web site and at the moment this time I am visiting this web
page and reading very informative articles or reviews here.
Wow, that’s what I was looking for, what a stuff!
existing here at this webpage, thanks admin of this site.
Hi, of course this post is truly pleasant and I have learned lot of things from it concerning blogging.
thanks.
Magnificent goods from you, man. I have understand your stuff previous to and you’re just extremely magnificent.
I really like what you have acquired here, really like what
you’re stating and the way in which you say it. You make it entertaining and you still care for to keep it smart.
I cant wait to read far more from you. This is really
a wonderful site.
It’s an awesome piece of writing in favor of all the web users;
they will get advantage from it I am sure.
If you would like to grow your familiarity simply keep visiting this website
and be updated with the newest news update posted here.
This website was… how do I say it? Relevant!! Finally I have found something that helped me.
Appreciate it!
Thank you, I have just been looking for info about this topic for a
while and yours is the greatest I have found out till now.
But, what about the conclusion? Are you positive about the supply?
Today, I went to the beachfront with my children. I found a sea shell and gave it
to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She placed the shell to her ear and screamed.
There was a hermit crab inside and it pinched her ear.
She never wants to go back! LoL I know this is completely off
topic but I had to tell someone!
Thanks for your personal marvelous posting!
I definitely enjoyed reading it, you may be a great author.I
will remember to bookmark your blog and will come back sometime soon. I want to encourage that you continue your great work,
have a nice afternoon!
I’m extremely inspired along with your writing abilities as well as with the structure to your blog.
Is that this a paid subject matter or did you customize it yourself?
Either way stay up the excellent quality writing, it’s uncommon to
peer a nice weblog like this one nowadays..
Hmm it seems like your blog ate my first comment (it was extremely long)
so I guess I’ll just sum it up what I submitted and say, I’m thoroughly enjoying your blog.
I too am an aspiring blog writer but I’m still new to everything.
Do you have any suggestions for beginner blog writers?
I’d certainly appreciate it.
This kind of FD scheme is mostly offered by banks and requires customers to deposit a sure sum of cash for a fixed time period.
Your latest blog post was truly inspiring and had some great insights. I can’t wait to see what else you have in store.
værdsætter dit indhold. Lad mig venligst vide det.
Thanks to my father who informed me regarding this weblog, this weblog is truly remarkable.
Znáte nějaké metody, které by pomohly omezit krádeže obsahu? Rozhodně bych ocenil
Your article helped me a lot, is there any more related content? Thanks!
Hi there this is kinda of off topic but I was wanting to know if blogs use WYSIWYG editors or if you have to manually code with
HTML. I’m starting a blog soon but have no coding know-how so I wanted to
get advice from someone with experience. Any help would be enormously appreciated!
Your mode of describing all in this piece of writing is truly pleasant,
every one be capable of easily know it, Thanks a lot.
Hi there to all, it’s truly a pleasant for me to go to see this website, it contains valuable Information.
501853 501179Definitely composed content material material , thankyou for data . 934265
Ahaa, its good discussion about this piece of writing here at this website, I have read all that, sonow me also commenting here.
I think this is among the most important info for me. And i am glad reading your
article. But want to remark on few general things, The web site style is ideal,
the articles is really nice : D. Good job, cheers
Way cool! Some extremely valid points! I appreciate you
penning this write-up and also the rest of the site is also really good.
Helpful information. Fortunate me I found your site unintentionally, and
I am shocked why this accident didn’t took place earlier!
I bookmarked it.
Excellent post. I was checking continuously this
blog and I’m inspired! Extremely useful information particularly the
last phase 🙂 I deal with such information a lot.
I used to be looking for this particular info for a very long time.
Thanks and best of luck.
Awesome article.
What’s Happening i’m new to this, I stumbled upon this I’ve discovered
It absolutely useful and it has helped me out loads. I hope to give a contribution & aid different customers like
its helped me. Good job.
Very good website you have here but I was wanting to know if you knew of any message boards that cover the same topics talked about in this article? I’d really love to be a part of group where I can get feed-back from other experienced individuals that share the same interest. If you have any recommendations, please let me know. Cheers!
Thanks for sharing your thoughts about taxi
Almere to Schiphol. Regards
En iyi Online Casino
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.