--显示指定用户打开的游标数 user_name = 指定用户
select o.sid, osuser, machine, count(*) num_curs
from v$open_cursor o, v$session s
where user_name = 'GTGDH' and o.sid=s.sid
group by o.sid, osuser, machine
order by num_curs desc;
--获取为游标执行的SQL语句 o.sid = 打开游标的SID
select q.sql_text
from v$open_cursor o, v$sql q
where q.hash_value=o.hash_value and o.sid = 11;