Yet another way to monitor Oracle GoldenGate with OEM12c

In a recent post on monitoring Oracle GoldenGate, I talked about how to configure the JAGENT to use Oracle Enterprise Manager 12c to monitor Oracle GoldenGate.  If you would like to review that post, you can find it here.  For this post, I’ll show you how you can use Metric Extensions within Oracle Enterprise Manager 12c to monitor Oracle GoldenGate. 

Note: Another good post on this topic can be found from my friend Maaz.  Here is his post.

As Maaz and I were talking about the finer aspects of the JAGENT, we started to talk about Metric Extensions to monitor Oracle GoldenGate.  This got me to thinking how this could be accomplished. 

One of the first things that is needed before you can set up a Metric Extension is how you are going to monitor the processes.  Being that most of the Oracle GoldenGate instances that I monitor are on Unix/Linux, I decided to use a Perl script to grab the basic info associated with Oracle GoldenGate.  This basically means, I just wanted to see what the current status of the processes was.  This is achieved from GGSCI using the INFO ALL command (Figure 1).

Figure 1: Info All
image

As you can tell, all of the Oracle GoldenGate processes are running.  In order to monitor these processes, they need to be put into a format that Oracle Enterprise Manager 12c can understand.  In order to do this, I used a Perl script to get the output in Figure 1 into a pipe delimited string.  The Perl script that I used to do this is located in Listing 1.

Listing 1: Perl Script
#!/usr/bin/perl -w
#
#
use strict;
use warnings;

#Static Variables

my $gghome = “/oracle/app/product/12.1.2/ggate”;

#Program

my @buf = `$gghome/ggsci << EOF
info all
EOF`;

foreach (@buf)
{
        if(/EXTRACT/||/REPLICAT/)
        {
                s/\s+/\|/g;
                print $_.”\n”;
        }
}

The Perl script provided (Listing 1) basically reads the output from the INFO ALL command into a buffer.  For everything in the buffer, look for any lines that have EXTRACT or REPLICAT in it.  Then replace all the spaces with a pipe (|) .  Lastly print out the output I want.  When the script is ran, you should get output similar to Figure 2.

Figure 2: Output from Perl script
image

Now that the output is in a pipe (|) format, I can use this in the Metric Extension.

Before we take a look at Metric Extensions, if you have never used them they are a great way to extend Oracle Enterprise Manager 12c to be more efficient in monitoring granular things. The documentation associated with Metric Extensions in Oracle docs are great and they are also covered in the Expert Oracle Enterprise Manager 12c book out by Apress.

To begin setting up a Metric Extension for monitoring Oracle GoldenGate, you need to go to the Metric Extensions page within Oracle Enterprise Manager 12c (Enterprise –> Monitoring –> Metric Extensions).    Once on the page, you are presented with a Create button about half way down the page (Figure 3).  The Create option can also be accessed from the Actions drop down.

Figure3: Metric Extensions Page

image

Once you click on the Create button, you will be taken to a wizard to begin developing the Metric Extension.  On the General Properties page, you need to fill out the required fields.  Since you are going to monitor this with a Perl script, the Target Type will be Host.  Then you need to name the Metric Extension (ME$).  Next provide the display name; this is the name that will show up in the All Metrics later.  Finally, the Adaptor drop down, select OS Command – Multiple Columns.  This way the metric will read the pipe (|) sign and break the string up.  Figure 4 provides you a screen shot.

Figure 4: General Properties
image

On the next screen, you need to provide the command that will run the script and the script that you want ran.  The delimiter field is a pipe (|) by default.  Fill in the required information (Figure 5).

Figure 5: Adapter
image

The Columns screen is next.  This screen is where you will setup the names of the columns and map what will go where.  Also, you can set the Alert Threshold for the the column that will be monitored.  One key think to point out here, you will need a PK for the data.  This basically means a unique way of identify an Oracle GoldenGate process.  For this configuration, the PK is the uniqueness between Program and Object.  Figure 6 illustrates how I have the columns configured for this setup.

Figure 6: Columns
image

Once you have the columns established, Oracle Enterprise Manager 12c will ask you what Credentials you want to use with this metric.  The default monitoring credentials are fine (Figure 7).

Figure 7: Credentials
image

Finally, you can test the Metric Extension and see how it is going to look.  This is your chance to make sure that all the values from the script return and appear how you expect them to be.  Figure 8, shows a successful test run.  If you have everything configured as expected, your output should come up in the Test Results without the pipe (|) signs.  If an error message is returned then investigate why you received it. 

In my testing, the errors I received were due to the PK issue with the columns when defined for the metric.

Figure 8: Test
image

Lastly, when you make it to the review screen, just check everything and click Finish.  Once you click Finish, you will be taken back to the Metric Extension landing page.  From the landing page, you can now deploy the metric to target the Metric Extension is to be associated with.

To deploy the Metric Extension, use the Action menu and select Deploy to Target.  Select the target which is should be deployed to (Figure 9).

Figure 9: Deploy to Targets….
image

Once you Metric Extension has been deployed to the selected target, you can then go to that target and check in All Metrics to see  how it looks.  For a host, you can do this by going to Targets –> Hosts.  Then select the host that you wanted.  From the Host menu, select Monitoring –> All Metrics.  Once on the All Metrics landing page, look for the name of the metric in the drop down tree then click on it.  You will be presented with the current status of the metric in the right-hand pane (Figure 10).

Figure 10: Metric Extension status in All Metrics
image

At this point, the Metric Extension for monitoring Oracle GoldenGate processes has been successfully developed, tested and deployed to a target.  The next step you need to accomplish is to ensure that you are notified when something happens to a process.  This is done with Notification Rules (not covered here).  Once the notification rules are established, monitoring Oracle GoldenGate using Metric Extensions is a great way to work around any JAGENT issues you may have.

Enjoy!

twitter: @dbasolved

blog: http://dbasolved.com

About these ads

5 comments

  1. Great blog post on multiple levels — interesting alternative way to monitor Golden Gate with OEM12c as an alternative to Oracle’s Golden Gate plugin It’s also a nice post describing a real-world example of creating and deploying a OEM12c metric extension.

    1. Thanks for the response.

      Bobby

  2. Good post Bobby. I’d left the actual Metric Extension creation out of my last post but thanks for putting this one together!

  3. […] ways to monitor GoldenGate, be sure to check out my older posts, Bobby Curtis’ posts (1 & 2), and his upcoming presentation at Collaborate 14. Coincidentally, he is sitting with me on the […]

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

Oracle Data Warrior

Changing the world, one data model at a time. How can I help you?

Maaz Anjum's Blog

A life yet to be lived...

PeteWhoDidNotTweet

Stuff that interests me, if not you!

The Oracle Instructor

Explain, Exemplify, Empower

Frits Hoogland Weblog

IT Technology; Oracle, linux, TCP/IP and other stuff I find interesting

Oracle Spin - Flimatech Blog

Sharing Our Database Experience

Oracle Scratchpad

Just another Oracle weblog

Oracle SQL Tuning Tools and Tips

SQL Tuning, eAdam, eDB360, SQLT, SQLHC

DBA Kevlar

Tips, tricks, (and maybe a few rants) so more DBAs become bulletproof!

Follow

Get every new post delivered to your Inbox.

Join 1,424 other followers

%d bloggers like this: