Resolving Locks

Performance Analysis for Oracle

Resolving Locks

Performance Analysis provides users the ability to review and investigate locking and blocking behavior for a monitored instance.  Lock investigation and analysis can be performed both in real-time using the Recent View, and for past locks using the History View.  For instance, if a database administrator is alerted to locking problems on the server, he can immediately open a Performance Analysis console, and using the Recent View, begin to investigate the cause of the blocking.  Once the problem is remedied, the DBA can use the History View to return to the point in time when the blocking behavior was identified to see what factors contributed to the problem.

Below are step-by-step instructions on how to review locking behavior using Performance Analysis.

Real-Time Analysis

  1. Click the Real-Time mode, to display the Recent tree Instance View node,

  2. Directly to the right of the treeview, above the graphical workload timeline, change the Resource value to Lock:

  3. Click the Blocking Locks tab to view the locking map. Use the displayed data to reveal lock and session parameters

  4. Review the blocking locks. The sessions that are causing blocking problems are displayed in the list.  

  5. Click the plus sign () to the left of the blocking session to display the locking map and reveal the BLOCKED processes (individual locks created by the blocking session). Only locks which actually resulted in a block are included. The lock icon () indicates a currently active lock.

  6. Click on one of the numeric hyperlinks presented to view the specific session’s activity.

  7. From within the Recent tree Current Sessions node, directly to the right of the treeview, above the graphical workload timeline, change the Resource value to Lock.

  8. Individual user sessions are listed at the bottom of the screen. The Lock Wait column represents the cumulative time a given session has waited for a locked resource. Double-click one of the sessions showing lock activity.

  9. After double-clicking a blocked/locked session, it is added to the left treeview under Current Sessions. You are now viewing information about the BLOCKED/LOCKED session.  Click the right-most tab, Session Locks to display both blocking and expired locks.

Historical Behavior

  1. A lock wait alarm () is generated either from the Home mode Lock Oracle Performance Resource Breakdown or from the Performance Advisories Locking metric.

  2. A one-click drilldown opens the History mode period with offending period and lock resource in focus.

  3. Click the Blocking Locks tab to display detail about the sessions blocking this session. Just like the Recent view, the data displayed applies to the BLOCKED/LOCKED session.  By default, Performance Analysis groups this information by the locked object.

  4. Use the information provided under the Blocking Locks tab to begin investigating the SQL statements executing under those dimensions during the same time period. This helps you determine the cause of the locking.  You can drill-down through several dimensions to collect useful information and further narrow your search, for key parameters, such as each session’s client machine, the executing program, the blocked SQL Statement, and the context information for the blocked session.