SCOM 2012 – Monitoring Oracle Database OLE DB Management Pack Template

As you know there are different ways to achieve certain things. It always depends on your requirements. In my latest blog post I would like to show how relatively easy it is to monitor an OLE DB connection to an Oracle database and also get some performance data.

My well-respected fellow SCSM Guru  and MVP Marcel Zehner (http://blog.scsmfaq.ch) provided me with this solution here, all credits to him.

The screenshots are in German but I will try to translate the options to English where necessary. It could be that my translation does not exactly match your setup in English but I do my best.

We have multiple steps to take in order to make the monitor function properly…

  • Step 1 – Install OLE DB provider
  • Step 2 – Configure database configuration file TNSNAMES.ora
  • Step 3 – Configure OLE DB Management Pack Template
  • Step 4 – Configure RunAs accounts

1) Install OLE DB provider

I assume you know what a watcher node is. On each watcher node where you want to perform the connection tests from install the OLE DB provider. For this provider you need to install the Oracle client tools.

Go to the Oracle site http://www.oracle.com and make sure you download the correct version in my case it is version 11g ~600MB to download.

1

Start the setup.exe…

2

Choose “Benutzerdefiniert” (Custom)…

3

Choose language…

4

Select installation path…

5

Select “Oracle Provider for OLE DB” and finish the installation…

6

Well done! Next step is to configure the connection, so that the client tools know where to find the database…

2) Configure Database Configuration File TNSNAMES.ora

In order to access the Oracle databases it is a must to configure the TNSNAMES.ora configuration file. In this file you define the server name, database name and alias.

You find the path to the file in the registry…

HKLM\Software\Oracle\Installation\TNS_ADMIN

7

Because you know now where the file should be, open Windows Explorer and go to this directory and create a file (regular text file) called TNSNAMES.ora…

8

Write down your configuration settings as needed in the following format…

image

You could also define more alias/servers if needed. To find more information about this kind of configuration file just use bing.

3) Configure OLE DB Management Pack Template

Start the wizard by clicking “OLE DB Data Source”…

10

Choose a name and a custom management pack where you want to store the monitor…

11

Click “Build…” and enter the information as shown in the screenshot. You can choose any provider, server and database because we are going to change this information/connection string on the next step…

12

If you select “Query to execute:” you actually can provide a select statement which will be execute against the database. If you don’t provide this query you won’t be able to select the performance thresholds on the next step…

image

Here you can select the performance thresholds which you want to measure and get warnings/errors about…

  • Connection time => How long it takes (maximum) to make a connection
  • Query time => How long it takes (maximum) to run the query statement
  • Fetch time => How long it takes (maximum) to fetch the results of the query

13

Next select the watcher nodes where you have installed the Oracle client tools from step 1…

15

After finishing the wizard we go to the “Properties” of the created monitor template…

16

Select the “Connection String” tab and modify the connection string to…

  • Provider=ORAOLEDB.Oracle
  • Data Source=[Alias you have defined in the TNSNAMES.ora file]

14

That’s it, the connection is setup. Next we define the access account…

4) Configure RunAs Accounts

In order to access the database we need to create the RunAs accounts. First we need to create an account type “Basic”…

17

Select “Basic Authentication” and a display name…

18

Set the credentials which have permission in the database…

19

Choose the distribution method you need in my case less secure and click “Create”…

20

Now we need to map the created user account to the appropriate profile. In our case we choose the “Oracle xxx Simple Authentication Profile”…

21

Click “Add…”…

22

Select the account we have created and select “All targeted objects”. Click “OK” and finish the wizards…

23

That’s it, now you should be able to monitor the Oracle connection…

Troubleshooting:

It could be that you might see theses errors in the OperationsManager event log on you watcher nodes…

24

If this happens it could be that..

  • Your TNSNAMES.ora file contains the wrong e.g. alias or connection settings
  • Your RunAs account/profile is not configured properly

I hope you like this post…

Cheers,

Stefan

6 Comments

  1. Pingback: Options for monitoring Oracle with Operations Manager

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