asm_metrics

asm_metrics.pl main page

The asm_metrics.pl utility is used to display ASM real-time metrics. It basically takes a snapshot each second (default interval) from the gv$asm_disk_iostat (or gv$asm_disk_stat depending of the version) cumulative view and computes the delta with the previous snapshot.

This utility:

  • provides useful metrics.
  • is RAC aware.
  • is fully customizable: you can aggregate the results depending on your needs.
  • does not install anything into the database or ASM instance.

It displays the following metrics:

  • Reads/s: Number of read per second.
  • KbyRead/s: Kbytes read per second.
  • Avg ms/Read: ms per read in average.
  • AvgBy/Read: Average Bytes per read.
  • Same metrics are provided for Write Operations.

At the following levels:

  • ASM Instance.
  • Database Instance.
  • ASM Diskgroup.
  • ASM Failgroup (Or cell’s IP on Exadata).
  • Disks.

Let’s see the help:

./asm_metrics.pl -help

Usage: ./asm_metrics.pl [-interval] [-count] [-inst] [-dbinst] [-dg] [-fg] [-ip] [-show] [-display] [-sort_field] [-help]

 Default Interval : 1 second.
 Default Count    : Unlimited

  Parameter         Comment                                                           Default
  ---------         -------                                                           -------
  -INST=            ALL - Show all Instance(s)                                        ALL
                    CURRENT - Show Current Instance
                    INSTANCE_NAME,... - choose Instance(s) to display

  -DBINST=          Database Instance to collect (Wildcard allowed)                   ALL
  -DG=              Diskgroup to collect (Wildcard allowed)                           ALL
  -FG=              Failgroup to collect (Wildcard allowed)                           ALL
  -IP=              IP (Exadata Cells) to collect (Wildcard allowed)                  ALL
  -SHOW=            What to show: inst,dbinst,fg|ip,dg,dsk (comma separated list)     DG
  -DISPLAY=         What to display: snap,avg (comma separated list)                  SNAP
  -SORT_FIELD=      reads|writes|iops                                                 NONE

Example: ./asm_metrics.pl
Example: ./asm_metrics.pl  -inst=+ASM1
Example: ./asm_metrics.pl  -dg=DATA -show=dg
Example: ./asm_metrics.pl  -dg=data -show=inst,dg,fg
Example: ./asm_metrics.pl  -show=dg,dsk
Example: ./asm_metrics.pl  -show=inst,dg,fg,dsk
Example: ./asm_metrics.pl  -interval=5 -count=3 -sort_field=iops
Example: ./asm_metrics.pl  -show=dg -display=avg -sort_field=iops
Example: ./asm_metrics.pl  -show=dg -display=snap,avg -sort_field=iops

The main options/features are:

  1. You can choose the number of snapshots to display and the time to wait between snapshots.
  2. You can choose on which ASM instance to collect the metrics thanks to the –INST= parameter.
  3. You can choose for which DB instance to collect the metrics thanks to the –DBINST= parameter (wildcard allowed).
  4. You can choose on which Diskgroup to collect the metrics thanks to the –DG= parameter (wildcard allowed).
  5. You can choose on which Failgroup to collect the metrics thanks to the –FG= parameter (wildcard allowed).
  6. You can choose on which Exadata Cells to collect the metrics thanks to the –IP= parameter (wildcard allowed).
  7. You can aggregate the results on the ASM instances, DB instances, Diskgroup, Failgroup (or Exadata cells IP) level thanks to the –SHOW= parameter.
  8. You can display the metrics per snapshot, the average metrics value since the collection began (that is to say since the script has been launched) or both thanks to the –DISPLAY= parameter.
  9. You can sort based on the number of reads, number of writes or number of IOPS (reads+writes) thanks to the –SORT_FIELD= parameter (See example here)

Examples:

IO activity reported for RAC ASM instances:

otech1

IO activity reported for ASM and database instances:

otech2

Visualize ASM preferred read in action and the associated metrics:

otech3

 

Blog posts related to it:

The last version of the asm_metrics.pl is 1.1

You can download it from this repository or copy the source code from this page.

9 thoughts on “asm_metrics

  1. Hi Bertrand,

    Great work on this asm_metrics.pl!! It has helped me greatly with I/O issues we have been experiencing on a production database where the LGWR was getting writes taking over 500ms and used it as evidence to blame the storage guys 🙂

    I also attended your presentation on the usage of R at UKOUG13 and in that you mentioned about working out a solution to graph the output of asm_metrics.pl. Just wondering, have you managed to make any progress on that?

    Cheers,
    Chris

    1. Hello Chris,

      I am glad to hear that the utility helped you. I really appreciate your feedback.

      You are right, I have in mind to graph the output of asm_metrics.pl and this is in my todo list.

      Maybe an abstract idea for UKOUG TECH 14 if ready 😉

      Cheers,
      Bertrand

    2. Hello Chris,

      You can visualize ASM metrics that way (See here).
      You can also find some use cases (See here).

      As you can see this is not “real time” graphing yet (I may do it later) but at least you can visualize and graph following your need.

      Thx
      Bertrand

      1. Thanks for getting back to me. I actually ow your blog and saw these new posts. Great work by the way!!!

  2. Hi
    Seem like usefull, however when I try to run the script it just tell “ERROR : You must connect to a asm instance”
    The script real_time.pl seem to work well however the asmiostat option (which is the interesting part for me) was moved.

    Any idea what is missing ?

    Thanks and regards
    Chagai

    1. Hi,

      “ERROR : You must connect to a asm instance” means that you have to “oraenv” on an ASM instance:

      . oraenv
      ORACLE_SID = [+ASM1] ? +ASM1

      Bertrand

  3. Hello, wonderful utility.

    Can the script be used by connecting to RDBMS only, i understand it will only get stats for that DB incase we have more than one DB instances plus we won’t get the full view …

    I modified

    our $inst_type=’asm’;

    to

    our $inst_type=’RDBMS’;

  4. Hi Bertrand,

    I have to say, you rocke man!!! This is amazing!!
    Would you alread consider to create a function to write the result in oracle tables for history search ?

    Thank you very much

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.