Re: making graphical reports from oracle metrics

The minimalist approach for the laziest DBA is this SQL:

SQL> col begin_interval_time for a30
SQL> col graph for a60
SQL> select begin_interval_time, value, rpad(' ',value/100000,'*') graph
  2  from dba_hist_sysstat a, dba_hist_snapshot b
  3  where a.snap_id = b.snap_id and
  4   stat_name = 'CPU used by this session' and
  5   begin_interval_time between to_date('20081102 00:00', 'yyyymmdd hh24:mi') 
and
  6                               to_date('20081202 00:00', 'yyyymmdd hh24:mi');

BEGIN_INTERVAL_TIME                 VALUE GRAPH
------------------------------ ---------- 
------------------------------------------------------------
01-DEC-08 10.00.40.298 PM         2451657  ***********************
29-NOV-08 03.00.16.053 AM         1734788  ****************
30-NOV-08 06.00.11.829 AM         1854296  *****************
26-NOV-08 01.00.09.731 PM          910173  ********
26-NOV-08 02.00.11.869 PM         1182984  **********
27-NOV-08 02.00.36.821 AM         1477696  *************
...

Change stat name, the value divisor (100000 here) and column width for graph as 
needed.

Yong Huang


      
--
http://www.freelists.org/webpage/oracle-l


Other related posts: