#!/bin/sh # # This is a shell archive. To extract its contents, # execute this file with /bin/sh to create the file(s): # # onstat_rau_ur.sh # # This shell archive created: Fri Aug 4 12:30:03 CDT 2000 # echo "Extracting file onstat_rau_ur.sh" sed -e 's/^X//' <<\SHAR_EOF > onstat_rau_ur.sh X#!/bin/sh X# 7/27/2000 X# The following script will show you the UR (read-ahead utilization X# ratio) and the BR (bufwaits ratio). Art Kagel gets all the credit X# for the formulas - I just got sick of using my calculator. X# This works with both my 7.31.UC2 and 9.20.UC1 engines, and will X# probably work with any 7.x or 9.x engine. X# It can be easily extended to chew on whatever onstat output. X X# Allen W. Jantzen, Database Administrator X# Ned Davis Research X# allenj@ndr.com X X$INFORMIXDIR/bin/onstat -p | awk ' X/[a-zA-Z]/ { X for(i=1; i<=NF; i++){ X name[i] = $i; X } X } X/[0-9]/ { X for(i=1; i<=NF; i++){ X content[name[i]] = $i; X } X } XEND { X ixdaRA = content["ixda-RA"]; X idxRA = content["idx-RA"]; X daRA = content["da-RA"]; X RApgsused = content["RA-pgsused"]; X print "Read Utilization (UR): ", (RApgsused / (ixdaRA + idxRA + daRA)) * 100, "%"; X X bufwaits = content["bufwaits"]; X bufwrits = content["bufwrits"]; X pagreads = content["pagreads"]; X print "Bufwaits Ratio (BR): ", ((bufwaits/(pagreads + bufwrits)) * 100), "%"; X print "The UR should ideally be very near 100%. The higher the better." ; X print "The BR should be below 7%. The lower the better." ; X}' SHAR_EOF if [ `wc -c < onstat_rau_ur.sh` -ne 1280 ] then echo "Lengths do not match -- Bad Copy of onstat_rau_ur.sh" fi echo "Done." exit 0