Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Open cursors metric and

VishnusivathejApr 26 2013 — edited Apr 27 2013
the following query
select sid,value from v$sesstat where statistic# in (select statistic# from v$statname where name='opened cursors current') and sid=20;
gives the list of count of cursors that are open by the session currently,
but the the following script
select sid,count(*) from v$open_cursor where sid=20 group by sid;
gives the number of cursors that are open by the session and are parsed.

But i just connected to the database and please see the following count.

SQL> select sid,value from v$sesstat where statistic# in (select statistic# from v$statname where name='opened cursors current') and sid=20;

SID VALUE
---------- ----------
20 3

SQL> select sid,count(*) from v$open_cursor where sid=20 group by sid;

SID COUNT(*)
---------- ----------
20 43


My question is that is the count that i am seeing in the v$open_cursor the complete number of cursors opened by a session during the life time? and v$sesstat gives only the count that is currently open....


BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

SQL>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 25 2013
Added on Apr 26 2013
6 comments
494 views