Metrics " Current Open Cursors Count "

Hi,
I get an Alert message Metrics " Current Open Cursors Count is at 1201 '" on 10g database version 10.2.0.1.0 . Can anyone help me to solve this.
Thanks
Sree

Sree,
The Metric corresponds to the number of records in V$OPEN_CURSOR internal view.
The number of open cursors is a function of the number of concurrent users and the application code ,so 1201 may not necessaryly indicate a problem – it could be that you system is genuinely very busy.
You should start worrying if the number of open cursors consistently grows over time (while the workload is steady). In this case you may have a “cursor leak” – a piece of code that opens a cursor, but does not close it.
You can check that with
select substr(sql_text,1,30) , count(*) cnt
from v$open_cursor
group by substr(sql_text,1,30)
order by 2 desc
If the current open cursor are getting close to the max allowed(OPEN_CURSOR parameter), you may reset them using share pool flush (note that the shared pool flush may have some small performance impact on the system).
Hope that helps,

Similar Messages

  • "Current Open Cursors Count" Warning

    I am getting this warning lately in my Grid Control repository database
    Metrics "Current Open Cursors Count" is at 1563
    Open cursors value fluctuates between 1400 and 2300.
    Is my open cursor threshold set too low (warning: default 1200, critical: not defined) and this is normal Grid Control behavior or I have some kind of problem here?
    Oracle 10g Grid Control (10.2.0.5)
    Linux x86

    Actually, it is just a message telling you that the Open Cursor Count has exceeded the threshold limit. If the number of open cursors continues to increase over time (from day to day, and constantly gets larger and larger, never gets smaller) then it may indicate a problem.
    I would suggest that you set the threshold to at least 2300, then wait and see if the alert shows up again. If it does then further analysis may be required to determine the root cause.
    I hope this helps!
    Edited by: CowTown_dba on Sep 22, 2010 10:01 AM

  • Current Open Cursors Count growing and growing

    Current Open Cursors Count appears to be a cumulative count and always growing since instance is started.
    Warning threshold of 1200 occurs quickly and regular warnings appears on OEM.
    (Oracle 10.1.0.4 on RHEL4AS Linux fresh install)
    The value reported on OEM correspond to:
    select name,value from v$sysstat where name like '%cursors current%';
    result: opened cursors current 194209
    Current open cursors are not
    select count(*) from v$open_cursor;
    which returns a more reasonable value: 293
    Any ideas about that ?
    Nicolas

    i have a tar opened on this .. its a bug with the database.
    After finding the query that OEM runs against the db, you
    will find that the stats the db is gathering at the database level are wrong .. they are cumulative. So until they patch the db, the metric in OEM is useless. Remove the warning/critical levels in the manage metric screen.
    NOTE: they dont use v$open_cursors .. that would be to easy :-)

  • Current Open Cursors Count

    That I have to make to correct this error
    Las métricas "Current Open Cursors Count" están en 1405
    my database sends me many messages like these. That I would have to make?
    thanks
    [email protected]

    HI,
    I had once read the following from Tom's site... I hope it will help you.
    ops$tkyte@ORA920LAP> select name, value
    2 from v$mystat a, v$statname b
    3 where a.statistic# = b.statistic#
    4 and b.name = 'opened cursors current'
    5 /
    NAME VALUE
    opened cursors current 1
    ops$tkyte@ORA920LAP>
    ops$tkyte@ORA920LAP> variable x refcursor
    ops$tkyte@ORA920LAP> variable y refcursor
    ops$tkyte@ORA920LAP> variable z refcursor
    ops$tkyte@ORA920LAP>
    ops$tkyte@ORA920LAP> exec open :x for select * from dual;
    PL/SQL procedure successfully completed.
    ops$tkyte@ORA920LAP> /
    NAME VALUE
    opened cursors current 2
    ops$tkyte@ORA920LAP> exec open :y for select * from dual;
    PL/SQL procedure successfully completed.
    ops$tkyte@ORA920LAP> /
    NAME VALUE
    opened cursors current 3
    ops$tkyte@ORA920LAP> exec open :z for select * from dual;
    PL/SQL procedure successfully completed.
    ops$tkyte@ORA920LAP> /
    NAME VALUE
    opened cursors current 4

  • Problem in  Oracle EM (Database Limits - Current Open Cursors)

    Hi everyone,
    I have a problem in Oracle Enterprise Manager in All Metrics.
    When I select in All Metrics e.g. Health Check > Maintenance it work's fine and I see a chart.
    If I select in All Metrics > Database Limits > Current Open Cursors Count I got following error:
    Error
    oracle.sysman.dbTarget.db.emSDKOverride.page.mtrx.GetDataException: ORA-06550: Zeile 79, Spalte 16: PL/SQL: ORA-00942: Tabelle oder View nicht vorhanden ORA-06550: Zeile 51, Spalte 7: PL/SQL: SQL Statement ignored
    What's the problem?
    In this database instance i drop these users (schemas): dbuser, mddata, ordplugins, ordsys, si_informtn_schema!!
    Can this lack of user to cause an error?
    Oracle Enterprise Manager Database Control 10.2.0.0
    Database instance: myDB > All Metrics > Database Limits > Current Open Cursors Count
    Thanks.
    Mark

    Hello Mark,
    personally I don;t think it is a good idea to drop schema's from the database that have been installed as part of the activation of a certain Database Option. If you don't want the option, then don't instal it.
    For a complete description of the schema's you are refering to, check: http://download.oracle.com/docs/cd/E11882_01/server.112/e10575/tdpsg_user_accounts.htm#BABGIBBA
    Regards
    Rob
    http://oemgc wordpress.com

  • Cache server metrics-Current Open connections

    hello all,
    I have a query regarding the dashboard cache server metrics in CMC.
    When I run the dashboards, data is getting cached in the cache memory, but dashboards are using that cached data only when the "Current Open connections" in the "Dashboard cache server metric" is non-zero.
    i.e., example when I run the dashboards for the first time, "Current Open connections" under Cache server metrics is 10. When I run the dashboards immediately with in 20 minutes, results would come very fast. But after 20 minutes , the "Current Open connections" are becoming 0(connections seems to be expiring) and after I run the dashboards, they are performing slowly though the data is present in the cache memory.
    I have tried changing the "Idle Connection timeout" to 240 minutes from the existing 60 minutes, still "Current Open connections" under Cache server metrics is becoming 0 after 20 minutes.
    Kindly help me as this is affecting the dashboards performance.
    Thank you.

    Hello,
    Appreciate any help on this. Attached is the screenshot of what I was referring to. "Currently Open Connections" becoming 0 in 20 minutes(even after the idle time connection timeout is increased to 240 minutes) , while the number of open connections shows the number.

  • Huge numbers of open cursors mistakenly reported

    Hi,
    We recently received an alert stating:
    Metrics "Current Open Cursors Count" is at 4294966978
    I'm trying to ascertain the source of the erroneous number of open cursors. There also seems to be a very strange graph on the alert page in EM. The graph shows the entire Y axis as: 4294966978, yet the plot moves up and down.
    Investigating the issue, I encountered a statistic even more bizarre. In EM, clicking on the Performance tab, and then selecting "Instance Activity" from the list at the bottom of the page, brings up a chart, and a radio button to switch to "Tabular" view. The Tabular view reports that:
    "opened cursors current" is 2^63-1
    Which is plainly impossible. Has anyone else noted this behavior, or have any insight into the cause of it? Viewing the v$ tables doesn't give anything like the bizarre numbers here.
    Thanks,
    Matt

    Do you see a version number in what you posted?
    Neither do I.
    Surely you don't expect people working an anything from 7.0.12 to 11.1.0.6 to have anything relevant to say with respect to your specific problem without know your operating system and version.
    What metalink docs have you searched looking or the answer?

  • Understanding Open Cursor

    Hi All, I am confused on this open cursor as I would like to understand further if I am hitting my limit. Currently I do not see the error that my open cursor exceeded.
    If I add up the a.value on the second sql, I am getting more than 10k, but my open cursor is only set to 5000. I must be calculating this wrongly here.
    open cursor = 5000
    session_cached_cursors 200
    select max(a.value), a.sid, b.program
    from v$sesstat a, v$session b, v$statname c
    where a.sid = b.sid
    and a.statistic# = c.statistic#
    and c.name = 'opened cursors current'
    group by a.sid, b.program
    order by 1 desc
    MAX(A.VALUE) SID PROGRAM
    2201 596
    516 514 abc@server1 (TNS V1-V3)
    401 720 abc@server1 (TNS V1-V3)
    602 670 abc@server1 (TNS V1-V3)
    578 445 abc@server1 (TNS V1-V3)
    129 rows selected.
    Would like to know what is the current open cursor count?
    If I get the sid like above, can I know what SQL is holding it up?

    What total do you get if you use the query from this article? See 'Monitoring open cursors'. Note that it includes serial#
    http://www.orafaq.com/node/758
    --total cursors open, by session
    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';
    If I sum up the a.value it is again more than 10k but the highest a.value is only 2000+
    OPEN_CURSORS specifies the maximum number of open cursors (handles to private SQL areas) a session can have at once. Since it is saying open cursor by a single session. I would suppose my max value now is 2000+ while my max_cursor set is 5000. Am I right?

  • How to get highest number of open cursors within the current calendar day

    Hi all ,
    i need to know how to get the highest number of open cursors within the current calendar day.
    Thanks ,

    823030 wrote:
    the issue is my customer is getting the error ORA-01000: maximum open cursors exceeded and we need an sql statment that gets the following values :
    -highest number of open cursors experienced in the current calendar day.
    -current open cursors
    -and maximum open cursorsThis error is rare. It happens when
    a) the value of the open cursor parameter is set extremly low (default is something like 1000). Low would be something like 10.
    b) <strike>you have many concurrent users(=sessions) and </strike>the application does not use bind values
    In this case each select will open a new cursor, instead of reusing it.
    c) you have a select that opens a cursor for each line. This can happen with a statement where you have the CURSOR keyword somewhere in the select or where clause. Those cursors will be closed when the select is finished. But during the run time of the select, all cursors stay open.
    To track the number of "open cursors" during the day you would need to implement some monitoring. Maybe based on the view that was already mentioned.
    Edited by: Sven W. on May 16, 2011 2:30 PM - since the parameter is on session level, other open cursors should not influence it much.

  • Keeping track of count of open cursors

    Is there a way to ask the API for a list of open cursors (or at least a count of) ?

    Hi Linda,
    Again, thanks for the reply.
    Yes, I wanted to use it to manage cursors while closing a database. At the moment I maintain a count of open cursors myself, I do this so that I can manage the close database process.
    I do this if I want to close the database:
    1. Prevent new cursors from being opened (reject all db updates & queries)
    2. Wait till open cursor count is zero
    3. close db
    However, it does mean having to wrap every query/update method in such a way that I can maintain the cursor count. I was setting up a few new databases and was just wondering if i'd missed something in the API to do this for me.
    Thanks,
    Joel
    Edited by: JoelH on 17-Dec-2009 08:57

  • Confused about Open Cursors :(

    Hi all,
    i need some clarification on this issue, i've read throught the documentation and i'm a bit confused.
    I'm using 10.1.0.2
    select sum(value)
    from v$statname sn,
    v$sesstat st,
    v$session s
    where sn.statistic# = st.statistic#
    and st.sid = s.sid
    and sn.name = 'session cursor cache count'
    The result of the above query is 4926, meaning i have 4926 CLOSED cursors in the session cursor cache.
    select count(1)
    from v$open_cursor
    The result of the above query is 16968, meaning i have 16968 cached cursors
    So there are two distinct cursor Caches ?
    now lets look at other statistic
    select sum(value)
    from v$statname sn,
    v$sesstat st,
    v$session s
    where sn.statistic# = st.statistic#
    and st.sid = s.sid
    and sn.name = 'opened cursors current'
    this one gives me 12212 , so i have 12212 opened cursors (NOT CACHED , REALLY OPENED CURSORS ...is this correct???)
    I suspect that my applications are not closing resultsets (java build application, deployed in oracle application server, database connections in pooled connection) ... so i'm trying to help my developers to find the potencial bug in application.
    How can i get the SQL from OPEN cursors ???
    V$open_cursor gives me SQL from CLOSED cached cursors ...
    Best Regards
    Rui Madaleno

    Hi,
    >>this one gives me 12212 , so i have 12212 opened cursors (NOT CACHED , REALLY OPENED CURSORS ...is this correct???)
    For your instance, yes because you use the sum(value) aggregate function. But I think that the best is get this value per session.
    select count(1) from v$open_cursor
    v$open_cursor shows cached cursors, not currently open cursors, by session. If you're wondering how many cursors a session has open, don't look in v$open_cursor. It shows the cursors in the session cursor cache for each session, not cursors that are actually open. To monitor open cursors, query v$sesstat where name='opened cursors current'. This will give the number of currently opened cursors, by session:
    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';
    >>I suspect that my applications are not closing resultsets (java build application, deployed in oracle application server, database connections in pooled connection)
    In this case, you need to monitor you application. If want, you can use the OEM Database Console and go to [Top Sessions | Session Details] link, or to use this SQL above.
    By the way, do you are getting ORA-1000 errors ?
    If so, set the OPEN_CURSORS parameter high enough that you never get an ORA-1000 during normal operations.
    Cheers

  • Open Cursor Issue because of file browse Item - Is this a Bug in APEX 3.2

    Hi All,
    I am using file browse Item to upload file into the database at two places in my application, but it seems whenever I am submitting those two pages, with file path or without file path, its opening an cursor which remains open after that, because of this open cursor count in the application is getting exceeding every time.
    For testing this I have made an dummy page containing just file browse item and submit button, and still it is increasing the open cursor count.
    Is this a bug in Apex file browse item or there is some other way to handle this.
    Please kindly help me in the above issue as this is affecting the production application.
    Thanks & Regards
    Sanjay
    Edited by: user11204334 on Dec 5, 2010 9:57 PM
    Edited by: user11204334 on Dec 5, 2010 9:58 PM

    Hi,
    One observation, Apex is switching the Session ID after one got killed ? I was working on Apex page with browse Item to test open cursor count,
    after killing the SID (227) on which the open cursor count was getting increase, it APEX automatically switches to new SID(149) for that session.
    Now the problem is even if I have two SID's and one hits the maximum open cursor count, It is not switching to other SID instead the whole application becomes unavailable.
    STATNAME SID VALUE USER
    opened cursors current 20 14 APEX_PUBLIC_USER
    opened cursors current 149 74 APEX_PUBLIC_USER
    opened cursors current 194 71 APEX_PUBLIC_USER
    opened cursors current 211 5 APEX_PUBLIC_USER
    opened cursors current 227 325 APEX_PUBLIC_USER Killed
    opened cursors current 244 15 APEX_PUBLIC_USER
    opened cursors current 20 14 APEX_PUBLIC_USER
    opened cursors current 149 76 APEX_PUBLIC_USER
    opened cursors current 194 71 APEX_PUBLIC_USER
    opened cursors current 211 5 APEX_PUBLIC_USER
    opened cursors current 244 15 APEX_PUBLIC_USER
    Please kindly help in this.
    Thanks in Advance
    Thanks & Regards
    Sanjay
    Edited by: user11204334 on Dec 8, 2010 1:02 AM

  • How to analyse the number of open cursors being used by each program?

    Hi,
    I am getting an error "ORA:1000 Maximum Open Cursors Exceeded" in my
    application. I want to analyse and monitor that how many cursors are
    being used  by each program running in a particular session. I have
    already set the Open Cursors Count double of the recommended for my
    application, yet I am getting this error.
    Is there any tool to analyse and monitor the number of cursors being
    used by each DB call?
    I have installed SAP NW 7.0 and Using Oracle 10g as DB.
    Your immediate help will be greatly appreciated.
    Best Regards,
    Smriti.

    You can list the open cursors per session and check which one uses the most with sqlplus:
    SQL> 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';
    Values over 300 are unusual.
    It is quite possible, that you see several workprocesses using a lot, because workprocesses are kind of shared sessions.
    Cheers Michael
    Edit: ah, our posts crossed, obviously there is no workprocess in the java world

  • TOO many OPEN CURSORS during loop of INSERT's

    Running ODP.NET beta2 (can't move up yet but will do that soon)
    I don't think it is related with ODP itself but probably on how .Net works with cursors. We have a for/next loop that executes INSERT INTO xxx VALUES (:a,:b,:c)
    statements. Apparently, when monitoring v$sysstat (current open cursors) we see these raising with 1 INSERT = 1 cursor. If subsequently we try to perform another action, we get max cursors exceeded. We allready set open_cursor = 1000, but the number of inserts can be very high. Is there a way to release these cursors (already wrote oDataAdaptor.dispose, oCmd.dispose but this does not help.
    Is it normal that each INSERT has it's own cursor ? they all have the same hashvalue in v$open_cursor. They seem to be released after a while, especially when moving to another asp.net page, but it's not clear when that happens and if it is possible to force the release of the (implicit?) cursors faster.
    Below is a snippet of the code, I unrolled a couple of function-calls into the code so this is just an example, not sure it will run without errors like this, but the idea should be clear (the code looks rather complex for what it does but the unrolled functions make the code more generic and we have a database-independend datalayer):
    Try
    ' Set the Base Delete statement
    lBaseSql = _
    "INSERT INTO atable(col1,col2,col3) " & _
    "VALUES(:col1,:col2,:col3)"
    ' Initialize a transaction
    lTransaction = oConnection.BeginTransaction()
    ' Create the parameter collection, containing for each
    ' row in the list the arguments
    For Each lDataRow In aList.Rows
    lOracleParamters = New OracleParameterCollection()
    lOracleParameter = New OracleParameter("luserid", OracleDbType.Varchar2,
    _ CType(aCol1, Object))
    lOracleParamters.Add(lOracleParameter)
    lOracleParameter = New OracleParameter("part_no", OracleDbType.Varchar2, _
    CType(lDataRow.Item("col2"), Object))
    lOracleParamters.Add(lOracleParameter)
    lOracleParameter = New OracleParameter("revision", OracleDbType.Int32, _
    CType(lDataRow.Item("col3"), Object))
    lOracleParamters.Add(lOracleParameter)
    ' Execute the Statement;
    ' If the execution fails because the row already exists,
    ' then the insert should be considered as succesfull.
    Try
    Dim aCommand As New OracleCommand()
    Dim retval As Integer
    'associate the aConnection with the aCommand
    aCommand.Connection = oConnection
    'set the aCommand text (stored procedure name or SQL statement)
    aCommand.CommandText = lBaseSQL
    'set the aCommand type
    aCommand.CommandType = CommandType.Text
    'attach the aCommand parameters if they are provided
    If Not (lOracleParameters Is Nothing) Then
    Dim lParameter As OracleParameter
    For Each lParameter In lOracleParameters
    'check for derived output value with no value assigned
    If lParameter.Direction = ParameterDirection.InputOutput _
    And lParameter.Value Is Nothing Then
    lParameter.Value = Nothing
    End If
    aCommand.Parameters.Add(lParameter)
    Next lParameter
    End If
    Return
    ' finally, execute the aCommand.
    retval = cmd.ExecuteNonQuery()
    ' detach the OracleParameters from the aCommand object,
    ' so they can be used again
    cmd.Parameters.Clear()
    Catch ex As Exception
    Dim lErrorMsg As String
    lErrorMsg = ex.ToString
    If Not lTransaction Is Nothing Then
    lTransaction.Rollback()
    End If
    End Try
    Next
    lTransaction.Commit()
    Catch ex As Exception
    lTransaction.Rollback()
    Throw New DLDataException(aConnection, ex)
    End Try

    I have run into this problem as well. To my mind
    Phillip's solution will work but seems completey unnecessary. This is work the provider itself should be managing.
    I've done extensive testing with both ODP and OracleClient. Here is one of the scenarios: In a tight loop of 10,000 records, each of which is either going to be inserted or updated via a stored procedure call, the ODP provider throws the "too many cursor errors at around the 800th iteration. With over 300 cursors being open. The exact same code with OracleClient as the provider never throws an error and opens up 40+ cursors during execution.
    The applicaation I have updates a Oracle8i database from a DB2 database. There are over 30 tables being updated in near real time. Reusing the command object is not an option and adding all the code Phillip did for each call seems highly unnecessary. I say Oracle needs to fix this problem. As much as I hate to say it the microsoft provider seems superior at this point.

  • Maximum open Cursors Excedded error - for every transaction

    Hi All,
    I am getting the maximum opn cursors exceeded error suddenly for every single db transaction i am trying to make in my application. this did not happen previously during my developemnt and testing phase.
    I have a question here that i tried to google but failed to get satisfactory answer.:-
    When we use a cursor in the stored procedure to fetch data, how to make oracle automatically close the cursors once the stored proc finishes executin. Or is there something i have to follow other with my current open cursors limit to ensure this problem does not happen?
    Thanks,
    Chaitanya

    Hi Justin,
    My oracle stored procs are called by java framework. In each place i was closing the connection object but there were a few places where i was not closing the resultset object which directly pointed to my oracle cursor.
    I have closed the objects in such places and tried again but still i am getting the same error. Mit it be an instance where the oracle db is not allowing me to connect to it at all. Something like restarting it would help? Restarting the server where the oracle software is hosted.
    Please excuse my blatant ignorance in this issue.
    Thanks,
    Chaitanya

Maybe you are looking for

  • I can't get my laptop to connect to the internet through my Ellipsis Jetpack.

    My laptop will connect to the jetpack but with limited access. It will connect to my mom's computer and my phone. I have windows 8.1 and she has windows vista.

  • My old 2006 iMac died-how do I transfer the files on my Time Capsule ti new iMac?

    When my 2006 Imac hard drive died I decided to get a new iMac. When I replace it with a new iMac how do I get to the files on my Time Caspule..I have all my old hard drive backed up on it so will my new iMac recognize it? How then do I back up my new

  • How to install Patch 6492514 over As 10.1.3.3?

    Hi, I have installed SOA suite version 10.1.3.1. over that i have applied the patch of 10.1.3.3.0 but now i am facing problem while applying patch 6492514 over that. problem occurs: D:\product\10.1.3.1\OracleAS_1\OPatch>opatch apply E:\6492514 Oracle

  • Consolidation of data in two different instances

    Hi, I am having a scenario that ABCD is a subsidiary of holding company PQRS. Both the systems are running on two different instances of SAP. Now the ABCD is going for SAP implementation. PQRS is interested to consolidate the data of PQRS as well as

  • Static or Dynamic parameter

    hi all, please help me regarding this.... 1)How to know whether a given parameter is a static parameter or dynamic parameter. 2)If we change dynamic parameter value using "alter system statment .." we no need to bounce the database right , that param