"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
Similar Messages
-
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 ?
Nicolasi 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 :-) -
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 -
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
SreeSree,
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, -
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.
MarkHello 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 -
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,
MattDo 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? -
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 MadalenoHi,
>>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 PMHi,
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 TryI 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,
ChaitanyaHi 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 -
Gurus,
When we try to detach analytic workspace, I get the following error
## Detail 0 ## java.sql.SQLException: ORA-33273: Analytic workspace FPA.FPAPJP has open cursors and cannot be detached.
ORA-06512: at "APPS.FPA_UTILITIES_PVT", line 129 ORA-06512: at "APPS.FPA_PROCESS_PVT", line 4685
ORA-34684: All of your attached analytic workspaces are read-only. Therefore, the UPDATE command will not save changes. ORA-06512: at line 1
The workspace " FPA.FPAPJP" has been opened in read-write mode and no explicit cursors are present in the code.
Any inputs are truly appreciate.
Thanks - SrujanThis is a new error to me. For what it is worth, here is a dba query to list open cursors by session.
select
vses.username||':'||vsst.sid username,
vstt.name,
max(vsst.value) value
from
v$sesstat vsst,
v$statname vstt,
v$session vses
where
vstt.statistic# = vsst.statistic# and
vsst.sid = vses.sid and
vstt.name in
('opened cursors current',
'opened cursors cumulative') and
vses.username is not null
group by
vsst.sid,
vses.username,
vstt.name
order by
vsst.sid,
vses.username,
vstt.name
/Here is a query to list all attach aws.
set pages 500 lines 110
col usn format a23 heading "USER (SID,SERIAL#,SVR)"
col aw format a22 heading "OLAP AW (ATTACHED)"
col generation format 99999 heading "Genrtn"
select username||' ('||sid||','||serial#||','|| decode(server,
'DEDICATED','D',
'SHARED', 'S', 'U')||')' usn,
gvawo.inst_id,
owner||'.'||daws.aw_name||' ('||
decode(attach_mode,
'READ WRITE', 'RW',
'READ ONLY', 'RO',
'MULTIWRITE', 'MW',
'EXCLUSIVE', 'XW', attach_mode)||')' aw,
generation
from
dba_aws daws,
gv$aw_olap gvawo,
gv$aw_calc gvawc,
gv$session gvses
where
daws.aw_number = gvawo.aw_number and
sid = gvawo.session_id and
gvawc.session_id = sid and
gvawo.inst_id = gvawc.inst_id and
gvses.inst_id = gvawc.inst_id
order by
username,
sid,
daws.aw_nameWas this a one off event or is it happening repeatedly? If it is a one-off, then closing the session or stopping and starting the database instance should resolve the problem.
Maybe you are looking for
-
Newbie with Distortion Problem, Audigy 2
Hello all you helpful people,?Seams common problem having spent the last 3 hours reading through the many posts on this subject, have to say the most helpful (easy to follow) was Jeremy's "read this before you post". Good man but unfortunatly it didn
-
Ldap_search_ext_s returned stickly first message
Hi I am using windows XP and using C++ program and I have this problem where the API returned me with the sticly first messages. the command used for the ldap_search is 1. if (( rc = ldap_search_ext_s( ld, "o=CRLs,c=SG,dc=data,dc=pkdDownload", LDAP_S
-
Anyone know if its possible to use Disk Utility to examine a External HDD connected to TC by ethernet (or USB). One of the volumes in the external HDD suddenly does not show up in the finder anymore. might be overful? I have the external HDD connecte
-
Missing API method writeStateMarker in ResponseStateManager
API doc of interface ResponseStateManager says something about a method writeStateMarker(), that is not defined anywhere. Since the ResponseStateManager is the only one, that knows (and should only know!) about the implementation dependent state mark
-
Hola. Soy una alumna de 3º ITI electronica y estoy realizando un proyecto final de carrera. Para nuestro trabajo necesitamos poder enviar la informacion (una vez tratada en labview) hacia dispositivos Bluetooth (movil, PDA) y mediante Wi-Fi. La verda