All HTML reports from Session window are named "HTML Window - SQL Monitoring Report"

After noticing that Session Browser detail tabs now support HTML, I added one to display the current execution plan. It works, but the window title is "HTML Window - SQL Monitoring Report". (Not a big deal, but just thought I'd mention it.)

btw as an enhancement request for Marco's list, it would be nice to have some more display options, e.g. automatically open in a new HTML window or an external application, configurable for each detail tab.

In case anyone's interested, the code is:

Code:
select '<!DOCTYPE HTML>
<html>
<head>
<title>Execution plan for SQL ID '|| :sql_id ||'</title>
<link href="M:\Web\css\clearlight.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="M:\Web\js\prettify.js"></script>
<script type="text/javascript" src="M:\Web\js\lang-plsql.js"></script>
</head>
<body onload="prettyPrint();">
<pre class="prettyprint linenums lang-plsql">' ||
rtrim(xmlagg(xmlelement(e,plan_table_output,chr(10)).extract('//text()') order by null).GetClobVal(),',')
|| '</pre></body></html>' as sql_plan_html
from   table(dbms_xplan.display_cursor(:sql_id, :sql_child_number, 'ADVANCED -PROJECTION'))

The CSS and JavaScript are from my Oracle-enabled cut of Google Code Prettifier, here:
github.com/williamrobertson/code-prettify
 
Last edited:
Thanks! There are quite a few uses for HTML in the Session Browser such as ASH and AWR reports, so this is really useful. The ability to open in an external browser (as already provided for CLOBs) would be really useful - for example ADDM reports won't be very readable in a default session browser tab (that's if we key an ADDM report to an active session, not that I've tried yet but it's on my list.)
 

Similar threads

Back
Top