Database Reference
In-Depth Information
On the Adapter tab, replace the old SQL with that in Listing 10-2, which collects information about the session
with the highest number of open cursors.
Listing 10-2. Modified SQL for Open Cursors Metric Extension
SELECT ROUND (c.open_cursors / p.value * 100) open_cursors_pct,
c.open_cursors, c.sid, s.username, s.machine,
s.program, s.osuser, s.process
FROM (select * from (SELECT sid, COUNT (*) open_cursors
FROM v$open_cursor
GROUP BY sid
ORDER BY COUNT (*) DESC)
WHERE ROWNUM = 1) c,
v$parameter p, v$session s
WHERE p.name = 'open_cursors'
AND s.sid = c.sid
On the Columns tab, you need to add new columns. Note that you set a comparison operator only on the
open_cursors column, in case somebody wants to use absolute cursor count as a threshold. Other columns can't
have any warning or critical conditions set, as they are intended only for informational purposes. See Figure 10-6 .
Figure 10-6. List of columns for the modified Open Cursors metric extension
Now test your metric extension. If everything is fine and metric collection works, finish its creation. You will see
the next version of the same metric extension with version number 2 appear on the Metric Extensions home page.
You can now save version 2 as a Deployable Draft and deploy it to verify that it works as expected. If a previous version
of the metric extension was already deployed on that target, it will be upgraded. The final step is to publish the latest
version so it's available to all users of EM12c.
When a newer version of the metric extension is published, the upgrade of the older deployment can be done
from the screen showing the target deployment. You can access this screen from the Metric Extensions home page:
click the link with the number of deployed targets for the previous version of a metric extension and then click the
Deploy button (select all targets you want to upgrade first). When that's done, you can see more columns in this
metric. The new metric extension collection will look like Figure 10-7 .
Search WWH ::




Custom Search