In my previous post, I mentioned how SQL Developer has evolved into more than a mere IDE that runs SQLs and PL/SQL code. Time to illustrate that with an example!
One of my favourite SQL Developer features is its capabilities on the reporting front. It can be such a useful tool for Retail DBAs, Programmers and Consultants alike to quickly zoom in on information they are looking for.
Now here is a report I use to quickly find RMS batches that take a long time to run. At the click of a button it conveys the run times visually (as opposed to numerically) which is very intuitive.
For e.g., in the run above it shows how sccext and orddscnt are the worst offenders. Between the two of them, they account for more time than all the other batches put together. Stkupld, hstbld and stkxpld also could benefit from some tuning after the first two are addressed. One could arrive at the same information by just running the SQL, but the visual aspect make reports more engaging.
And this is the SQL query that runs behind the scenes:
select restart_name, restart_name, round(max(finish_time-start_time)*24*60) as elapsed_time from restart_program_status where nvl(finish_time-start_time,0) > 0.0001 group by restart_name order by 3 desc
If you want to download the report, click here. Go to Reports > User Defined Reports, right click and choose Open Report.
Or if you want to go through the experience of building it yourself, just follow these steps:
Right click User Defined Reports in the Report tab, then select New Report.
Type in a name and select Chart as the Report Style.
Paste the SQL in the SQL text area.
Go to the Property page of the report, and select Bar - Vertical Stack for the Chart Type.
Go to the Titles page and fill in the optional Titles and Footnotes.
Now just hit Apply and off you go!