soojinkim has asked for the wisdom of the Perl Monks concerning the following question:

Hi!
I am wondering whether there are any scripts or tools available to create a graph from Oracle queries. For example, I would like to collect all the values from
"select to_char(trunc(first_time, 'HH24'),'DY DD-MON-YY HH24:MI')
"HOUR", count(*) "LOG COUNT"
from v$loghist
group by trunc(first_time, 'HH24')
order by trunc(first_time, 'HH24');"
and generate a graph. I have installed PerlTk, DBI and DBD and now I am kind of stuck. If any of you have come across any thing to do that please let me know.

Thanks in advance. soojin kim

Edit kudra, 2001-10-17 Added some markup

Replies are listed 'Best First'.
Re: Create a graph from Oracle Queries
by MZSanford (Curate) on Oct 17, 2001 at 12:31 UTC
Re: Create a graph from Oracle Queries
by princepawn (Parson) on Oct 17, 2001 at 09:26 UTC
Re: Create a graph from Oracle Queries
by perrin (Chancellor) on Oct 17, 2001 at 17:41 UTC
    You may want to look at StatsView, which graphs Oracle stats, or Orac, which is a Perl/TK tool for adminning an Oracle database, complete with some graphing functionality.
Re: Create a graph from Oracle Queries
by {NULE} (Hermit) on Oct 17, 2001 at 21:01 UTC
    Hi,

    This came up on the Chatterbox recently as a point of conversation. There are many options but depending upon your criteria, they may not all be good solutions.

    GD is good if you want to make exportable images directly from Perl. The downside is that getting and installing GD can be difficult - particularly if you desire TrueType Font support (libfreetype). GD::Graph does make using plots easier as was already mentioned.

    Tk is good for real-time viewing of charts, which is something I do for my employer, but it is abysmal for trying to save images in an exportable format.

    For most things I find myself simply creating a datafile that can be read in by gnuplot. This provides a simple interface for creating graphs without making your Perl code too complicated. Of course gnuplot makes use of libgd so you need that installed anyway.

    Good luck,
    {NULE}
    --
    http://www.nule.org

Re: Create a graph from Oracle Queries
by soojinkim (Initiate) on Oct 18, 2001 at 10:56 UTC
    Thanks for your replies. I installed PerlTk and I could get syntax about creating buttons and forms but not graphs. I installed DBD::Graph but my piechart wouldn't show up on the screen. Orac-1.2.3 is a surely cool kit but not sure what it can do to help me to devleop the script. Sounds pretty stupid but I really need some example scripts to help me out. Thanks.