Foglight for Oracle includes two rules for detecting long-running database locks:
These rules monitor blocking caused by database locks. They do not alert simply because a database session or query has been running for a long period of time.
The rules evaluate how long a blocking condition has existed and compare that duration against the configured alarm threshold. This allows Foglight to alert when database blocking continues longer than the configured time.
The rule used depends on whether SQL Performance Investigator (SQL PI) is enabled:
This article explains how these rules detect blocking, what information they use, and how the alarm thresholds can be configured.
A database session can hold a lock while another session waits for access to the same database resource. Long-running locks can result in multiple sessions waiting and may affect application performance.
The Long Lock Running rules monitor these conditions and compare the lock or blocking duration against the configured alarm thresholds.
This is a Data Driven rule that uses the standard Oracle Locks History Tree data.
Oracle lock and session information is collected from Oracle database objects such as:
The rule evaluates information from the most recent lock tree snapshot. It compares the seconds_in_wait value against the configured Long Lock Running alarm threshold.
The rule also correlates the session ID (sid) with the locking session ID (locking_sid). This allows Foglight to determine the relationship between the blocking and blocked sessions.
When this information is available, the rule can report details such as:
When SQL PI is enabled, the DBO - SPI Long Lock Running rule is used.
This is also a Data Driven rule, but it uses SQL PI blocking history instead of the standard Locks History Tree.
The rule evaluates the longest_duration value from the blocking history and compares it against the configured SPI Long Lock Running alarm threshold.
SQL PI also provides Blocking History information that can be used to investigate blocking conditions historically.
When either Long Lock Running alarm occurs, review the available blocking information to determine:
The DBA or application owner can then investigate the SQL or transaction associated with the blocking session and determine why it continues to hold the lock.
The alarm identifies a database blocking condition. It does not by itself indicate a Foglight product problem.
The thresholds for the Long Lock Running alarms can be configured using Alarm Templates.
The configured thresholds determine how long the blocking condition must exist before the corresponding alarm severity is triggered.
Use the appropriate Oracle Alarm Template to review or modify the thresholds for:
For the standard DBO - Long Lock Running rule, the minimum lock duration used for collecting Locks Historical Tree data can be configured under:
Global Administration > Collection Settings > Locks
The History Locks Tree collection creates lock tree snapshots based on the configured minimum lock duration.
In environments with a large number of locks, increasing the minimum duration can reduce the amount of Locks Historical Tree data collected.
Important: The collection frequency for the History Locks Tree collection should not be changed.
Caution: If the History Locks Tree collection is disabled:
In older Oracle cartridge releases:
Both rules are designed to detect long-running Oracle database locks. The main difference is the source of the blocking information:
seconds_in_wait.longest_duration.The alarm thresholds are configurable through Alarm Templates.
The information collected by these rules can help the DBA identify the blocking and blocked sessions and investigate the database transaction responsible for the blocking condition.
Customers who require assistance investigating database locking conditions beyond the information provided by the alarm, or who require training on using Foglight to analyze locks and blocking, can engage Quest Professional Services.
Quest Professional Services can provide environment-specific assistance, best-practice guidance, and training. Contact your Quest Account Manager or Quest representative for information about available Professional Services engagements.