Database Reference
In-Depth Information
The development lifecycle of metric extensions is a little more involved compared to the old-style UDMs, but
that's what makes metric extensions simpler to manage at scale in a multiuser environment. To access the Metric
Extensions home page, choose Enterprise Monitoring Metric Extensions. There you will see a quick overview of
the metric extensions development lifecycle, as shown in Figure 10-1 .
Figure 10-1. Metric extension development lifecycle
Your First Metric Extension
Let's create a sample metric so you can see the process in action. Let's say you need to monitor how close the sessions
in your database get to the maximum number of open cursors per session. That maximum is controlled by the
open_cursors init.ora parameter. You can use the query in Listing 10-1 to return the percentage of open cursors in
terms of the defined maximum.
Listing 10-1. SQL for Open Cursors Metric Extensions
SELECT ROUND (c.open_cursors / p.value * 100) open_cursors_pct
FROM (SELECT sid, COUNT (*) open_cursors
FROM v$open_cursor
GROUP BY sid
ORDER BY 2 DESC) c,
v$parameter p
WHERE p.name = 'open_cursors' AND ROWNUM = 1
Creating the New Metric Extension
To create this metric, click the Create button on the Metric Extensions home page, just above the table listing available
metric extensions. If the button is grayed out and not clickable, you don't have permission to create new metric
extensions. You need to have the Create Metric Extension privilege granted by your EM Super Administrator. This
privilege is assigned while creating or editing an EM user from the Resource Privileges screen, in the row Metric
Extensions Resource. There is only one relevant privilege: Create Metric Extension. This privilege allows you to create
and import new metric extensions.
After you click the Create button, the new Metric Extensions Wizard appears. Figure 10-2 shows the wizard's
General Properties tab.
 
Search WWH ::




Custom Search