Чтобы ответить на первоначальный вопрос о том, как получить индекс в виде целого числа для желаемого выбора, будет работать следующее:
df[df['A']==5].index.item()
Всего открытых курсоров по сеансам:
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';
Источник: http://www.orafaq.com/node/758
Насколько мне известно запросы по v $ представления основаны на псевдотаблицах (таблицы «x $»), которые указывают непосредственно на соответствующие части SGA, поэтому вы не можете получить более точную информацию; однако это также означает, что чтение выполняется на определенный момент времени (т.е. грязное чтение).
Here's how to find open cursors that have been parsed. You need to be logged in as a user with access to v$open_cursor and v$session.
COLUMN USER_NAME FORMAT A15
SELECT s.machine, oc.user_name, oc.sql_text, count(1)
FROM v$open_cursor oc, v$session s
WHERE oc.sid = s.sid
GROUP BY user_name, sql_text, machine
HAVING COUNT(1) > 2
ORDER BY count(1) DESC
;
If gives you part of the SQL text so it can be useful for identifying leaky applications. If a cursor has not been parsed, then it does not appear here. Note that Oralce will sometimes keep things open longer than you do.