IBM Support

nmon : Can we break out four Oracle Instances in the graphs?

How To


Summary

Regular nmon saves the "oracle" processes command name in the TOP process records so you can't determine the busy Oracle RDBMS instance from an idle one. With a little scripting, we can see the individual databases (instances) by using the UARG (User Arguments) data.

Objective

Nigels Banner

Environment

This approach was tested with AIX nmon data.
The performance monitoring command nmon needs to be run with, at least, the following options: nmon -fT
  • The "T" capture top processes (TOP rows) and process user command arguments (UARG rows).
The sample file used has 20 snapshots to make it easy and quick to test.

Steps

Without any data manipulation, we get one "oracle" bubble on the Top Summary graphic and one Oracle line on the Top Processes. These graphs are samples produced by the nmonchart script, which generates a web page with 35 or more performance graphs.
Before - single Oracle total
image 5225 image 5212
After - four Oracle instance graphs 
  • Oracle_sales and oracle42 are instances are using significant CPU time but oracleHR and oracleTEST are under 3%.
After the script adjustments, the graphs include the four oracle instances in the "Top Summary" and "Top Commands" graphs produced by nmonchart.
image 5227

image 5226

Why one bubble of graph line for all the Oracle processes?

Normally, the nmon Analyser and nmonchart use the TOP data for these graphs. The data includes the program name, which for Oracle is called "oracle". All "oracle" processes stats are added up to one total number. Oracle tries to reduce the memory foot print by using same binary for every Oracle Relational Database Management Systems function and Oracle instance, so the program name used is "oracle" regardless of the instance. This totaling is useful in most cases but not if you want to find out which RDBMS Instance is using the CPU the most and when it is not helpful.

What do we need to change to show the Oracle instances?
We need to replace the oracle process names in the TOP process stats by comparing the process id's in the UARG lines and then changing the TOP processes command to include the instance name. Here is an example, where command name "oracle" becomes oracle_sales for this process. Other Oracle processes have other instance names. In this data, instannce e oracle_sales, oracleTEST, oracleHR and oracle42.
  • TOP,17508144,T0001,26.53,23.79,2.74,1,429796,303616,30604,2255566,0,0,oracle,Unclassified
  • UARG,T0001,17508144,1,oracle,1,user1,group1,oracle_sales (LOCAL=NO)
Becomes
  • TOP,17508144,T0001,26.53,23.79,2.74,1,429796,303616,30604,2255566,0,0,oracle_sales ,Unclassified
  • UARG,T0001,17508144,1,oracle,1,user1,group1,oracle_sales (LOCAL=NO)
How to do that?
It is not a pretty script and could be improved. I am going to assume you are familiar with Korn shell scripting.
Extract the TOP lines, UARG lines from the original nmon file and create a file without those lines:
  grep ^TOP o.nmon >top  grep ^UARG o.nmon >uargs    grep -v ^TOP o.nmon | grep -v ^UARG >notop  grep -v ora top >top_noora
Create a file called trans with this contents:
  doit()  {  grep $1 top | sed "s/,oracle,/,$2,/" >>newtop  }  
Extract Process IDs and Oracle DB names from UARG lines and add to the end of trans file
  grep ora uarg | awk -F, '{ print $3 " " $9 }' | sed 's/_/ /g' | sed 's/oracle/ a b /' | awk '{ print "doit "$1 " " $4 }' | sort | uniq  >>  trans
  • Note: sed 's/_/ /g' and sed 's/oracle/ a b /' Handles the processes names like: ora_abcd_sales
Now trans content is something like:
    doit()   {   grep $1 top | sed "s/,oracle,/,$2,/" >>newtop   }     doit 10093208 oracle_sales   doit 10093620 oracle_sales   doit 10289596 oracleHR   doit 10486582 oracle42   doit 10617276 oracle42   doit 10617804 oracleTEST   doit 10682846 oracleHR   doit 10682972 oracle42   ... 400+ lines     
Run trans to modify the top file into a newtop file
  ksh <trans 
Rebuild the nmon file with the newtop
 
  cat notop newtop top_noora  >oracle_fixed.nmon 
Run nmonchart to generate the graphs (that we saw at the top):
  ./nmonchart oracle_fixed.nmon   
The new web page file of graphs is called oracle_fixed.html
The two key graphs were shown near the top of this blog.
- - - The End - - -

Additional Information


Find move content from Nigel Griffiths IBM (retired) here:

Document Location

Worldwide

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"ARM Category":[{"code":"","label":""}],"Platform":[{"code":"PF002","label":"AIX"}],"Version":"All Versions","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
09 June 2023

UID

ibm11165408