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.
- 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).
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:
- You can choose the number of snapshots to display and the time to wait between snapshots.
- You can choose on which ASM instance to collect the metrics thanks to the –INST= parameter.
- You can choose for which DB instance to collect the metrics thanks to the –DBINST= parameter (wildcard allowed).
- You can choose on which Diskgroup to collect the metrics thanks to the –DG= parameter (wildcard allowed).
- You can choose on which Failgroup to collect the metrics thanks to the –FG= parameter (wildcard allowed).
- You can choose on which Exadata Cells to collect the metrics thanks to the –IP= parameter (wildcard allowed).
- You can aggregate the results on the ASM instances, DB instances, Diskgroup, Failgroup (or Exadata cells IP) level thanks to the –SHOW= parameter.
- 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.
- 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)
IO activity reported for RAC ASM instances:
IO activity reported for ASM and database instances:
Visualize ASM preferred read in action and the associated metrics:
Blog posts related to it:
- ASM metrics are a gold mine. Welcome to asm_metrics.pl, a new utility to extract and to manipulate them in real time
- Find out the most physical IO consumers through ASM in real time
- Flex ASM 12c (12.1): be careful to “invisible” I/O !
- ASM I/O Statistics Utility V2
- Flex ASM 12c (12.1) and Extended Rac: be careful to “unpreferred” read !
- ASM Preferred Read: Collect performance metrics thanks to my amsiostat utility and SLOB 2
- ASM I/O Statistics Utility
- ASM Preferred Read: Collect performance metrics
- ASM I/O Statistics Utility: Update for Exadata
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”
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?
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 😉
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.
Thanks for getting back to me. I actually ow your blog and saw these new posts. Great work by the way!!!
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
“ERROR : You must connect to a asm instance” means that you have to “oraenv” on an ASM instance:
ORACLE_SID = [+ASM1] ? +ASM1
That’s great, exactly what I need ! 🙂
Thank you and good job !
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 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