Oracle Performance through Active Session History and execution-plan analysis

ASHFlow shows the Oracle professional where to focus their performance tuning efforts: find the statements worth tuning, see why their plans are slow, and fix them.

Free for 10 days starting now with a work email address, or for 30 days after a short review. There is no password: an emailed code signs you in.

One investigation, top down

Every screenshot on this site is the real application on a real database. These run on our demo database, under contention we caused on purpose.

  1. 1 Activity
  2. 2 Wait event
  3. 3 Statements
  4. 4 Row lock
  5. 5 Plan time
  6. 6 Estimates

1 of 6

What is the database waiting on?

Database Activity charts the last 15 minutes of ASH as average active sessions, stacked by wait class; the legend names them. Here Scheduler, CPU, Application and Commit all show at once. Scheduler is Oracle Free's own CPU limit at work.

Needs the Diagnostics Pack

Full-size screenshot

ASHFlow's Database Activity screen: 15 minutes of average active sessions by wait class, with CPU, Scheduler, Application and Commit stacked, and the Top SQL list below

2 of 6

Which wait event is it?

Hover a band and it splits into its wait events, busiest first. The Application band is 1.40 active sessions of enq: TX - row lock contention, 13:05:00 to 13:05:10.

Needs the Diagnostics Pack

Full-size screenshot

ASHFlow's Database Activity chart with the mouse over the Application band; the tooltip reads 1.40 active sessions, enq: TX - row lock contention

3 of 6

Which statements are behind it?

Top SQL, under the chart, ranks the statements in the same window. 68vkudy84d5pg has 900 seconds, all of it Application. 4drhmxx6mqwya has 754, mostly CPU. We follow both.

Needs the Diagnostics Pack

Full-size screenshot

ASHFlow's Database Activity screen with the Top SQL list below the chart: SQL_ID 68vkudy84d5pg first with 900 seconds of Application, then 4drhmxx6mqwya with 754 seconds, mostly CPU

4 of 6

What is the first statement waiting for?

Double-click a statement for its plans. 68vkudy84d5pg is an UPDATE of three rows that several sessions want at once. Its time is waiting, not working: all of it Application. Hovering names the event, enq: TX - row lock contention, 1.30 active sessions, 13:11:40 to 13:11:50.

Needs the Diagnostics Pack

Full-size screenshot

ASHFlow's SQL Plans screen for an UPDATE, SQL_ID 68vkudy84d5pg, whose activity chart is all Application waits; the tooltip reads 1.30 active sessions, enq: TX - row lock contention

5 of 6

Where in the plan did the time go?

Now the second statement. Pct of Total puts the time on each plan line. In 4drhmxx6mqwya, 68.3% is on the hash join, 21.3% on the full scan of ORDER_ITEMS and 7.8% on the full scan of ORDERS.

Needs the Diagnostics Pack

Full-size screenshot

ASHFlow's SQL Plans screen for SQL_ID 4drhmxx6mqwya: the plan tree with the time on each line and estimated and actual cardinality, the last 20 runs, the SQL text and the statement's activity chart

6 of 6

Where did the optimizer guess wrong?

Est Card against Act Card, shaded by how far off and where in the plan. The optimizer estimated 1,000 rows from ORDER_ITEMS and got 7,716,663; ORDERS, estimated at 1 row, returned 8,128. We made the statistics stale on purpose.

Needs the Tuning Pack

Full-size screenshot

ASHFlow's SQL Plans screen for SQL_ID 4drhmxx6mqwya: the plan tree with estimated and actual cardinality, ORDER_ITEMS estimated at 1,000 rows and 7,716,663 actual

Then pin a better plan

The same statement, 4drhmxx6mqwya, from its list of plans to a SQL profile.

  1. 1 Better plan
  2. 2 Profile
  3. 3 Result

1 of 3

Has it ever run faster?

The plan list holds every plan the statement has had, from the cursor cache and from AWR. Plan 1884789994, kept in AWR, ran in 1.7 seconds a run; the current plan, 3168062403, takes 8.3. Each plan has an Add Profile button.

Needs the Diagnostics and Tuning Packs

Full-size screenshot

ASHFlow's SQL Plans screen for SQL_ID 4drhmxx6mqwya listing two plans, 8.2974 and 1.6507 seconds a run, each with an Add Profile button; the faster plan, from AWR, is selected and its plan shown

2 of 3

Pin the faster plan

Add Profile writes the script and shows it before anything runs: the plan's outline hints, loaded with DBMS_SQLTUNE.IMPORT_SQL_PROFILE. Copy it to run yourself, or Execute Profile. It changes the plan for every session, and the dialog says so.

Needs the Diagnostics and Tuning Packs

Full-size screenshot

ASHFlow's Add SQL Profile dialog for plan 1884789994: a warning that it changes the plan for every session, and the generated script with the plan's outline hints

3 of 3

Did it take?

The plan list says so: SQL Profile: PROF_4drhmxx6mqwya_1884789994 (ENABLED), with Disable and Remove Profile beside it. Plan 1884789994 is now CURRENT, at 2.05 seconds a run.

Needs the Tuning Pack

Full-size screenshot

ASHFlow's SQL Plans screen after the profile: the bar reads SQL Profile: PROF_4drhmxx6mqwya_1884789994 (ENABLED) with Disable and Remove Profile buttons, and plan 1884789994 is CURRENT

Or trace it

A 10046 trace of the same statement, read in ASHFlow. Tracing and Trace Analysis need no pack.

  1. 1 Activity
  2. 2 Trace
  3. 3 TKPROF

1 of 3

Every call, not samples

ASH samples each active session once a second: enough to rank statements, not to count their calls. For every parse, execute and fetch, trace a session running the statement. Here, 4drhmxx6mqwya again.

Needs the Diagnostics Pack

Full-size screenshot

ASHFlow's Database Activity screen with the Top SQL list below the chart; SQL_ID 4drhmxx6mqwya is second, with 754 seconds

2 of 3

Switch the trace on

Session Activity on Home lists every session and what it is running. Tick Trace beside a session running 4drhmxx6mqwya and ASHFlow starts a 10046 trace with its waits; Stop Trace ends it.

Needs no pack

Full-size screenshot

ASHFlow's Home screen: Top SQL by ASH activity, and Session Activity with the Trace box ticked for a session running SQL_ID 4drhmxx6mqwya

3 of 3

What did each call cost?

Trace Analysis lays the file out as tkprof does. In 40 seconds: 3 executions and 124 fetches, 29.49 seconds elapsed, 16.84 of them CPU and 12.40 waiting on resmgr:cpu quantum. The row source lines give the real rows: 7,716,663 from ORDER_ITEMS.

Needs no pack

Full-size screenshot

ASHFlow's Trace Analysis screen: the statement 4drhmxx6mqwya, its Parse, Execute and Fetch calls, the row source operations with real row counts, and the waits

That was Database Activity, SQL Plans with its Add SQL Profile dialog, Session Activity and Trace Analysis. The Product page goes through the rest, including the Log Switch Heatmap, which shows redo by the hour and the DML behind it.

Where it runs

ASHFlow is a desktop application used as an Oracle client - no need to install some elaborate backend monitoring tool that monitors everything under the sun or that requires a series of agents on each of your database servers. Here you can watch performance with a dedicated tool and take concrete actions in real time.

What it needs

ASHFlow works within your licensing framework or the limitations you give it but for most effective use, it requires Oracle Diagnostics Pack and Enterprise Edition.

Start a free trial

ASHFlow connects straight to your database. There is no server, no agent and no repository database to set up first.

  1. Create an account. We email you a code. There is no password.
  2. Ask for the trial. 10 days starting now with a work email address, or 30 days after a review, usually within one business day.
  3. Download and check it. Every release is listed with its SHA-256 hash.

ASHFlow is in public beta. The beta terms are Schedule A of the license agreement. What it does, screen by screen · Pricing, or request a quote to pay by purchase order · Security & Trust and releases with SHA-256 hashes, for reviewers.

The full site is being built. Pages that are not finished say so.