Home » RDBMS Server » Server Administration » Cursors opened by an user
Cursors opened by an user [message #62776] Fri, 13 August 2004 01:07 Go to next message
Shibaji Ghosh
Messages: 39
Registered: April 2002
Member
Hello,

How do we know how many cursors are opened by a particular user in Oracle.

Thanks in advance,
Shibaji

 

 
Re: Cursors opened by an user [message #62785 is a reply to message #62776] Fri, 13 August 2004 06:29 Go to previous messageGo to next message
Frank Naude
Messages: 4580
Registered: April 1998
Senior Member
Hi,

Here a query to get the "open cursor count" for each session:

SQL> SELECT sid, value "Open Cursors"
  2    FROM sys.v_$sesstat
  3   WHERE statistic# = (SELECT statistic#
  4                         FROM sys.v_$statname
  5                        WHERE name = 'opened cursors current'
  6                      )
  7  /

       SID Opened Cursors
---------- --------------
       148              1
       152              4
...


Best regards.

Frank
Re: Cursors opened by an user [message #62788 is a reply to message #62776] Fri, 13 August 2004 08:22 Go to previous message
Jagdeep
Messages: 15
Registered: August 2004
Junior Member
I hope this would help too -

SELECT user_name, sid,COUNT (*) num
FROM v$open_cursor
GROUP BY user_name,sid;

You can join the sid,serial# to V$session to get any other infornation about the users too.

Thanks
Jagdeep
Previous Topic: Transaction
Next Topic: ORA-00904 invalid column
Goto Forum:
  


Current Time: Fri Sep 27 08:27:03 CDT 2024