One of the problems with the the Oracle tables that contain tuning statisticsg is that the statistics are cumulaitve, so it is hard to see what is happening g between time A and B. Running bstat/estat does this automaitically but it g can be a overkill if you want to justg know a few things about what is happening in the datatbase.g Also if you have bstat and estat set in a cron job to gather statistics on theg database every day, then using bstat/estat to monitor during that time period isg not possible without messing up the daily cron job's bstat/estat.(you get the sameg reaction running bstat on two different nodes in OPS) The typical g solution has been to create tempory tables, much as bstat/estat does, and take theg difference of the values stored in the temporary tables taken at time A and g those currently in the database, time B. This can be a bit costly, and even g impossible on some databases where the creation of tables has been contrained byg init.ora parameters (Europecar site for example). So another solution is to useg plsql arrays to store the values. One problem with plsql is reading the output. g There is dbms_output package, but it has a buffer limit, and in general I don't g think it was created to be a standard output package. The other posiblity is tog create a function that is read from a select statement in sql that reads the arrayg values. This is what mon.sh does. It redisplays the values every sleep cycle.g g
Of course doing this in Pro*c or OCI would be a good idea. I'll get aroundg to it someday, but let me know if you do it yourself. Of course I like scriptsg because the are easy to change and no need to compile, but C would be goodg for making the calculations more efficient, and portability better.