Open cursors


Job details

Name: Open cursors
Platform: Oracle
Category: Performance
Description: Checks and collects the amount of open cursors per session.
Long description: Task checks and collects the amount of open cursors performed per session.
Version: 1.7
Default schedule: 10,30,50 * * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘oracle’]/.[hasengine=‘YES’]

Parameters

Name Default value Description
warning threshold 99 Returns warning when the percentage (default 99%) of maximum open cursor is reached.
history threshold 14 The number of days the statistics are collected in the history table.
ignore dbwatch sessions YES If “YES“ the dbWatch Engine sessions created by dbWatch Server are excluded from being checked.

Job Summary

select s.username "User name", s.sid "Session ID",s.program "Program name" ,s.machine "Host name",a.value "Opened cursors"
from v$sesstat a, v$statname b, v$session s
where a.statistic# = b.statistic#  and s.sid=a.sid and s.username is not null and b.name = 'opened cursors current'
order by 5 desc

Implementation Details

The job involves several key operations elaborated below:

  1. Creation of tables to store historical data on open cursors and ranking information:
  2. “dbw_open_cur_histr” for historical data including session ID, username, program name, cursor count, and date of recording.
  1. A stored procedure “open_cur_check” is executed to:
  2. Fetch the configured warning and history thresholds.
  1. Dependency management is also handled to ensure that all components and tables required by the task are appropriately linked and managed.

Reporting and Output

The results of the monitoring are presented through various ways in dbWatch reports:

Dependencies

Dependency Object Object Type Description
open_cur_check 2 (self-referencing task) This check depends on its instance to function correctly.
dbw_open_cur_histr 0 (table) Historic table that needs proper setup and management.
dbw_och_rank 0 (table) Table needed for ranking sessions based on cursor counts.

This monitoring job is vital for maintaining the health and performance of Oracle database environments by ensuring that the use of cursors is within acceptable limits.