ThatJeffSmith

SQL Developer 4 and the Oracle Diagnostics Pack

Oracle Database Enterprise Edition customers have the option of extending their functionality set via various optional ‘packs.’ One of the most popular packs is the Oracle Diagnostics Pack.

Funny, most people call it the ‘Diagnostic’ Pack, but it’s technically known as the Diagnostics Pack. Anyways, the pack includes a LOT of features. You can see all of them listed here.

Now in previous versions of Oracle SQL Developer, we have exposed a few of these features via several reports, including:

  • ASH Report For the Past 30 Minutes
  • ASH Rows Detail
  • Daily ASH Statistics Chart
  • Last AWR Report

In version v4.0 (new for Early Adopter 2!), we have greaty expanded the support for the Diagnostics Pack. But instead of building additional reports, we’ve created an entirely new Performance node in the DBA panel:

To access the DBA panel, open it via the View menu, and then add a connection.

To access the DBA panel, open it via the View menu, and then add a connection.

Before using any of these features, you’ll be asked to confirm that you do indeed have licensed said features.

There’s too much to go over in a single post here, but I’ll cover a few basic scenarios.

Running an AWR Report

The first thing you need to do is decide what time period you want to run the report against. AWR stands for Automatic Workload Repository. The repository contains performance and diagnostic stats for a period of time collected via snapshots. These snapshots are setup to be taken on a regular interval.

You can optionally create a baseline which is simply a pre-defined stand and end group of snapshots. These can be easier to reference than manually picking the start and end snapshot periods.

You can see the available snapshots and the time period they cover.

You can see the available snapshots and the time period they cover.

Now, what if you want to see what was going on for the past few minutes and there’s no snapshot to cover that activity? Well, you could go into the Active Session History (ASH) bits, but since we’re talking about AWR here, I’ll mention you can force a new snapshot to be taken on demand.

Simply open the Snapshots tree and right click.

You can also delete snapshots from here.

You can also delete snapshots from here.

Now with my snapshot newly created and available, I can go back to my AWR report viewer and select it.

Now hit the ‘Go’ button :)

The AWR report viewer toolbar

The AWR report viewer toolbar

The report will now be generated and displayed inside of SQL Developer. Since we can render basic HTML, it’s not an issue. You’ll find the in-report hyperlinks are navigable. But if you want a little nicer presentation, you can send the report to your default web browser using this button;

This sends the report to your browser

This sends the report to your browser

Like so…

The report is spooled out to your OS/User temp directory

The report is spooled out to your OS/User temp directory

If you want a more permanent version of the report, you can also save it using the appropriate toolbar button. Hint, it’s the button that looks like a disk :)

I Want to Know More About A Particular Query

If I’m looking at my Top SQL portion of my AWR report, I can pull out a SQLID of note, and then feed that to the AWR SQL Report Viewer.

Don't know the SQLID? You can browse the available ones for the given snapshot time range.

Don’t know the SQLID? You can browse the available ones for the given snapshot time range.

One More Thing

There’s nothing more frustrating than running a report only to notice it’s not the report you wanted. And instead of having to start completely over, you can simply use the ‘Toggle Inputs’ button and tweak your settings. Me likey A LOT. And I didn’t even ask for this bit, the developer came up with it himself. And why am I surprised…. ;)

Reconfigure your settings and re-run the report as needed.

Reconfigure your settings and re-run the report as needed.

I also like that the SQLID and Snapshot ‘pickers’ are smart enough to auto-scroll in the grid to that particular value. It’s these little things I think that will make the users happy. Having the reports is nice, but making them easy to generate and work with is what will bring them back.