Top 60 Oracle Blogs

Recent comments

Using ASH Analytics to View Blocked Sessions

When concurrency is the crippling factor in a database performance issue, often I’m told that viewing blocked sessions in Enterprise Manager is difficult.  The query behind, along with flash image generation in any Enterprise Manager can take considerable time to render and no matter how valuable the view is, the wait is something DBAs just can’t hold out for when needing the answer now.

Blocking Sessions View in OEM

If you’re wondering which feature I’m speaking of, once you log into any database, click on Performance, Blocking Sessions.


If there aren’t any or any significant load on the database, it can return quite quickly.  If there is significant load and blocking sessions, well, you could be waiting quite some time….

Behind the Scenes

The query that is run behind the scenes will be executed by the DBNSMP, (or whatever user you have configured for use from a target to communicate with the OEM) to the database in question and will look like the following:

#4444dd; font-weight: bold;">select#000000;">sid#000000;">,#000000;">username#000000;">,#000000;">serial#000000;">##000000;">,#000000;">process#000000;">,#000000;">nvl#000000;">(#000000;">sql_id#000000;">,#000000;">0#000000;">)#000000;">,#000000;">sql_address#000000;">,#000000;">blocking_session#000000;">,
 #4444dd; font-weight: bold;">from#000000;">v#000000;">$#4444dd; font-weight: bold;">session
 #4444dd; font-weight: bold;">where#000000;">blocking_session_status#000000;">=#cc0000;">'VALID' #4444dd; font-weight: bold;">OR #000000;">sid #4444dd; font-weight: bold;">IN
 #000000;">(#4444dd; font-weight: bold;">select#000000;">blocking_session
 #4444dd; font-weight: bold;">from#000000;">v#000000;">$#4444dd; font-weight: bold;">session
 #4444dd; font-weight: bold;">where#000000;">blocking_session_status#000000;">=#cc0000;">'VALID'#000000;">)

So what do you do when you need blocking information quickly and can’t wait for the Enterprise Manager Blocking Sessions screen?  Use ASH Analytics to view blocking session information!

ASH Analytics View Options

Start out by telling me you have installed ASH Analytics in your databases, right?  If not, please do this, it’s well worth the short time to install the support package and view via an EM Job for this valuable feature.

Next, once its installed or if you’ve already installed it, then for any database target Home Page in the EM12c, click on Performance, ASH Analytics.


The default timeline will come up for ASH Analytics.  If the blocking is occurring now, no change to the time window will be required and you’ll simply scroll down to the middle wait events graph.


Notice that no filters or session data is present on the current graph and it’s focused on the standard Wait Class data.  This can be updated to view blocking sessions and offer very clear info on the sessions and waits involved by doing the following quick changes:

Switch to

  • Load Map from Top Activity
  • Switched to Advanced Mode
  • Chose the following Dimensions of data to display
             – Blocking Session
             – User Session

You will see the following data displayed instantly on the screen, without the wait.


You will see the blocking sessions and below, will be displayed the sessions blocked for each.  If there is more than one session blocked, it will show as a second, third, fourth box, etc. under the blocking session ID.

Advanced Dimensions for Blocking Sessions

If you want to build out and see what wait events are involved on the blocking session, this can be done as well.  Just move the Dimensions bar below the load map from two dimensions to three.  Then add another dimension to the load map.


I now can see that I have a concurrency issue on one of the blocking sessions, (calling same objects) and the second blocking session is waiting on a commit.

The additional advantage of using this method to view blocking session data is that it’s not just “current blocking data” that is available as when you use the “Blocking Sessions” view in OEM.


Using ASH Analytics allows you the added option to move the upper bar to display time in the past or move it to view newer data just refreshed.

If there is specific data that you are searching for, (username, SQL_ID, etc.)  change the dimensions to display what you are interested in isolating.  ASH Analytics supports a wide variety of data to answer questions about blocking sessions along with all other types of ASH data collected!









Copyright © DBA Kevlar [Using ASH Analytics to View Blocked Sessions], All Right Reserved. 2014.