Oracle-DB: Retrospective analysis of blocking locks with Panorama
The recorded session activity in Oracle databases (Active Session History / ASH) enables the retrospective analysis of locking scenarios between database sessions.
This post shows how the free performance analysis tool Panorama supports this investigation.Precondition for using ASH is the Enterprise Edition of Oracle DB and the licensing of the Diagnostics Pack.
If you don't have licensed Diagnostics Pack or you are running Standard or Express Edition, then you can use the similar function of Panorama-Sampler to record the session activity. Panorama evaluates both sources (AWR/ASH or Panorama-Sampler) transparently in the same way.
In general there are several ways in Panorama for retrospective evaluation of previous blocking lock situations:
- Top down analysis of lock dependency tree to identify a root blocking session
- Top down analysis of wait event dependencies to get an overview based on blocking and blocked events (new in Panorama)
- Bottom up analysis to find the root cause of a particular blocked session
Top down analysis of lock dependency tree to identify the root blocking session
Both root session analysis and wait event analysis are available in menu "DBA general" / "DB-Locks" / "Blocking locks historic from ASH".
Choose the time period to consider at first and hit the button "Blocking locks session dependency tree".
Top down analysis of wait event dependencies to get an overview based on blocking and blocked events
Bottom up analysis to find the root cause of a particular blocked session
From each single ASH record of a blocked session you can pass through the blocking sessions dependency tree up to the root blocking session that is not blocked by any other session.
Here are single ASH records of a blocking/waiting event combination:
Hit button "Thread" in column "Block." to view the whole dependency tree up to the root blocking session:
This way you see all sessions included in the lock dependency tree and identify the session causing this locking cascade.
Some times you may also see a cross dependency that is cleared later on by the database by "deadlock detected". The last session before cycling in dependency is marked "DEADLOCK" in this case.
Please feel free to try out this functions and share a comment if you have been successful (or not).
Comments
Post a Comment