Using Grid to display database CPU usage
Posted by John Hallas on September 3, 2010
There was a recent post on the Oracle -L list asking about using Grid Control to report on a particular databases cpu usage during a certain period of time. A number of answers came in showing the sql queries that would answer the question but I saw the question being ‘ how can we display the CPU usage in Grid’ or indeed how can we produce a customised metric report on any database in Grid
However for those who are interested in the recommended scripted methods then the the answers that were of most use in my view were from Karl Arao pointing to a script he has written and Rich Jesse produced the following code
SELECT mmd.* FROM sysman.mgmt$metric_daily mmd JOIN sysman.mgmt$target mt ON mmd.target_name = mt.target_name AND mmd.target_type = mt.target_type AND mmd.target_guid = mt.target_guid WHERE mmd.metric_column like '%cpu%' AND mt.target_name = B_NAME AND mt.target_type = 'oracle_database';
My method was to create a report that could be used to report on any instance and this is how I did it.
On OEM select create report and give it a title, category and sub-category. This is how where it will be located in the reports tab. Select target type of ‘Database Instance’ and select a time period, in my case the last 24 hours.
Now add 2 new elements as I am going to produce a report with two metric graphs in. Edit the set parameters tab
Then ensure that the appropriate metrics are selected by choosing the target type ‘Database Instance’ but again inherit target. Select whichever metric you are interested in and then repeat the process for the second required graph.
Now all you need to do is to look at the preview, enter a SID and hey presto
Finally our end reports looks like this – all we need to do s run the report and select the instance name
I hope that has proved useful and demonstrated how easy it is to run a customised report which can be run against any desired instance