A while ago I read a blogpost by Tanel Poder about HTMLizing your sqlplus output. I used to make sqlplus scripts with HTML output. But I stopped doing that at my previous site, because we had 70 customers, so almost half of 70 ways of making VPN connections and also nearly as many ways of copying the HTML output to an environment where there was a browser and the HTML would load reasonably fast. You can’t beat viewing a text file of a few kilobytes then. On my current site however access to all database servers is standard and fast. So why not HTMLize my scripts now?
So here it is: sql_sql_id_html.sql. One thing has changed: it uses AWR data without warning. You enter the sql_id and child_number and it will query dba_hist_% tables right away. So internally Oracle will count that as one more usage of the Diagnostics Pack (in dba_feature_usage_statistics). Just so you know.
I’m actually really happy about the way the output looks. I use the output frequently to discuss SQL performance issues with developers and other DBAs (and they ask me “how on Earth did you get that query response time data in your report?”). I’ve even rebranded the output file as “SQL performance reports” when I discuss them in meetings. I always had a thing for marketing ;)
If you run the script and scroll to the end of it, you will notice a graph. That’s a Google Chart API graph. That is why you need internet access to view the graph. Otherwise the cold, hard data is still there in a table above it. I still want to improve the graph. I want response time and executions on different Y-axes. And I would like to see ticks with values on both X- and Y-axes (now you have to move your mouse over the graph).