Verificar quantidade de cursores abertos

Verificar quantidade de cursores abertos

Abaixo você verifica a quantidade de cursores abertos e o tamanho total.

select max(a.value) as highest_open_cur, p.value as max_open_cur
from gv$sesstat a, gv$statname b, gv$parameter p
where a.statistic# = b.statistic#
and b.name = 'opened cursors current'
and p.name = 'open_cursors'
group by p.value;

Query abaixo mostra os cursores abertos junto com o username, SID e SERIAL da sessão.

select a.value, s.username, s.sid, s.serial#
from v$sesstat a, v$statname b, v$session s
where a.statistic# = b.statistic#
and s.sid = a.sid
and b.name = 'opened cursors current'
and s.username is not null;