using grid to display database cpu usage « oracle dba – a lifelong learning experience

4
Using Grid to display database CPU usage Posted by John Hallas on September 3, 2010 There w as a recent po st on the Oracle -L list asking about us ing Gri d 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 answ er the question but I saw the question being ‘ how can we display the CPU usage i n Grid’ or indeed how can we prod uce a customised me tric report on any database in Grid Howev er for those who are interested in the recommended scripted methods then the the answers that were o f most use in my view were from Karl Arao pointi ng to a script he ha s wri en and Rich  Jesse produced the following code 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. Sel ect target type of ‘Database Instance ’ and select a ti me period, in my case the last 24 hours. 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 = :DB_NAME AND mt.target_type =  'oracle_database' ; Using Gri d to display dat abase CPU usa ge « Oracle DBA – A lifel ong ... https: //jhdb a.word press.c om/20 10/09 /03/usi ng-gr id-to-d ispla y-data bas... 1 de 4 27/09/2015 11:57

Upload: felix-mateos-medrano

Post on 02-Mar-2018

229 views

Category:

Documents


0 download

TRANSCRIPT

7/26/2019 Using Grid to Display Database CPU Usage « Oracle DBA – a Lifelong Learning Experience

http://slidepdf.com/reader/full/using-grid-to-display-database-cpu-usage-oracle-dba-a-lifelong-learning 1/4

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 aparticular databases cpu usage during a certain period of time. A number of answers came inshowing the sql queries that would answer the question but I saw the question being ‘ how can wedisplay the CPU usage in Grid’ or indeed how can we produce a customised metric report on anydatabase in Grid

However for those who are interested in the recommended scripted methods then the the answersthat were of most use in my view were from Karl Arao pointing to a script he has wri en and Rich

 Jesse produced the following code

My method was to create a report that could be used to report on any instance and this is how I didit.

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, inmy case the last 24 hours.

SELECTmmd.*FROM

sysman.mgmt$metric_daily mmdJOINsysman.mgmt$target mtON mmd.target_name = mt.target_nameAND mmd.target_type = mt.target_typeAND mmd.target_guid = mt.target_guidWHERE

mmd.metric_column like '%cpu%'

AND mt.target_name = :DB_NAMEAND mt.target_type = 'oracle_database';

ng Grid to display database CPU usage « Oracle DBA – A lifelong ... https://jhdba.wordpress.com/2010/09/03/using-grid-to-display-databas...

4 27/09/2015 11:57

7/26/2019 Using Grid to Display Database CPU Usage « Oracle DBA – a Lifelong Learning Experience

http://slidepdf.com/reader/full/using-grid-to-display-database-cpu-usage-oracle-dba-a-lifelong-learning 2/4

Now add 2 new elements as I am going to produce a report with two metric graphs in. Edit the setparameters tab

Then ensure that the appropriate metrics are selected by choosing the target type ‘DatabaseInstance’ but again inherit target. Select whichever metric you are interested in and then repeat theprocess for the second required graph.

ng Grid to display database CPU usage « Oracle DBA – A lifelong ... https://jhdba.wordpress.com/2010/09/03/using-grid-to-display-databas...

4 27/09/2015 11:57

7/26/2019 Using Grid to Display Database CPU Usage « Oracle DBA – a Lifelong Learning Experience

http://slidepdf.com/reader/full/using-grid-to-display-database-cpu-usage-oracle-dba-a-lifelong-learning 3/4

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 instancename

ng Grid to display database CPU usage « Oracle DBA – A lifelong ... https://jhdba.wordpress.com/2010/09/03/using-grid-to-display-databas...

4 27/09/2015 11:57

7/26/2019 Using Grid to Display Database CPU Usage « Oracle DBA – a Lifelong Learning Experience

http://slidepdf.com/reader/full/using-grid-to-display-database-cpu-usage-oracle-dba-a-lifelong-learning 4/4

I hope that has proved useful and demonstrated how easy it is to run a customised report whichcan be run against any desired instance

This entry was posted on September 3, 2010 at 11:05 am and is filed under Grid control and agents,Oracle, scripts. Tagged: DBA metrics, Grid report, OEM report. You can follow any responses to

this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “Using Grid to display database CPU usage”

» Best Oracle Peformance Tools? said

 January 13, 2011 at 6:24 pm[…] nice links from Karl Arao: h p://www.pythian.com/documents/ExtendingOracleEnterpriseManager10g.pdf h ps://jhdba.wordpress.com/2010/09/03/using-grid-to-display-database-cpu-usage/ h ps://jhdba.wordpress.com/2010/06/21/producing-a-grid-report/ h p://oracleobserver.com/?q=node/23 […]

Reply

1.

ng Grid to display database CPU usage « Oracle DBA – A lifelong ... https://jhdba.wordpress.com/2010/09/03/using-grid-to-display-databas...

4 27/09/2015 11 57