
User-Defined Metrics can be build using SQL or using scripting languages such as bash. For now we will quickly focus on how to build a simple check with SQL. In the example below I will show how you can build a check on the number of invalid objects in your database.
The first thing you need to do is to find a way how you can achieve what you want via a SQL script. In case of the number of invalid objects you can use the query below;
SELECT
COUNT(1)
FROM dba_objects
WHERE status = 'INVALID'
Now we have to define the User-Defined metrics in Oracle Enterprise Manager. To do so navigate to "targets" -> "Databases". Below at the end of the page you will find a link "User-Defined Metrics" which will bring you to the page as show in the screenshot below.


I have also stated that every 15 minutes the system will have to check. If you push test you will get the value and you will see if it is working. When you press OK the check will be created.


No comments:
Post a Comment