Cursors opening limits

hi all:
i have a oracle 9i database with initialization parameter open_cursors set to 500.When my application running,ora-01000 error ocurred.I have queried the dynamic view v$sesstat by "select value from v$sesstat where statistic#=3 and sid=65;" which returned 500.
I do not want to examine application codes in order to find the sql statements causing the error.So my question is how i can find the sql statements openning 500 cursors.
thank you.

Hi,
You would have to go through the code to check. Whether you are closing all record sets and statements properly. If yes then no way but to increase the number in your initialization parameter file.
All the best
Aarbi

Similar Messages

  • Too many Cursors open error

    I have been getting this error in my Jdeveloper App.
    ORA-01000 : maximum open cursors exceeded.
    We have open cursors set at 220. I am using straight JDBC thin
    to call the database (8.1.5) and have been closing ResultSets
    the best I can. It happens after I use the app for a little bit.
    Any suggestions on what is causing this.
    PS
    This is a test database and I am the only one on it.
    Thanks
    Greg
    null

    PreparedStatement ps = null;
    RsultSet rs = null;
    try {
    // Do work here
    } catch (Exception erx) {
    // handle error
    } finally {
    try { rs.close(); } catch {}
    try { ps.close(); } catch {}
    In this way, you should never leave a cursor open.
    null

  • Cursor open error SQLSTT - 72000, SQL code - 969

    We have purchased a product called Access Manager for DB2 and installed it on our AS400. This gives us the connectivitiy to Oracle server with which we do the Warehouse management software interface using our legacy system on AS400.
    I have written several programs in SQLRPGLE and not quite sure as to how I can handle errors coming out of Oracle server.
    As per my knowledge in my programs, I do
    declare cursor
    open cursor
    fetch
    dow look for sqlstate
    fetch next row
    enddo
    close cursor
    I am also new to this much of SQL.
    Now, my programs are running in production and works just fine if we don;t have any issues with oracle server (database server down etc.).
    My question is if the database server goes down for any reason, my SQLRPGLE progam starts giving me cursor not open errors, the actual error is as follows:
    Connection to relational database HJAWCD1 already exists.
    ARDUPAR: ARDUPAR: rc=-1(OCI_ERROR) from OCIStmtExecute when asking for
    Describe-Info
    ARDUPAR(1): ORA-03114: not connected to ORACLE
    ARDAROC: rc = -1 from parse
    SQLSTATE class unknown - SQLSTATE 72000, SQLCODE -969.
    Cursor SEHOST not open.
    Cursor SEHOST not open.
    Cursor SEHOST not open.
    So although, the connection exist between the AS400 and Oracle server as suggested from first statement, but then the cursor is giving me problems of not opening.
    what I would like to know is how do I check in my SQL statement the error and somehow reconnect and open the cursor again.
    Please help in this regard, since I am not finding any help from iseries world becuase no one seems to have knowledge about this product that we have installed and I don;t have too mcuh of documentation on the product nor do I have any sample handling messages program using RPGLE between oracle and AS400 using the product.
    Regards
    Farhan Qadri

    It's been over a decade since I worked on an AS/400 (iSeries), but I've seen an ORA-03114 is thrown from the OCI when you've attempted an illegal statement. That error typically means you are no longer connected to the database. I'd guess that your new application has a defective RPG error management routine.
    Good luck, Michael

  • Max no of cursors opened

    Hi all,
    For our project we are using Oracle8i as back-end. I am using JDBC api to manipulate the data in the oracle database.
    I am getting an error saying that "Max no of cursors opened exceeds limit". This error am freq getting. It causes the table locking.
    Is this happening becuase of ResultSet is not closing?
    Will ResultSet automatically closed if I close the statment object in finally block of my code or do I need to close the ResultSet explicitly.
    Is there any solution for this. This am getting if no of clients are concurantly update the same table.
    Any suggestions and solutions appreciated.
    thanks in advance
    ANILA

    It's been asked here before, but I'm embarrassed to confess that I still don't know the answer:
    What if you're using a connection pool? My understanding of pools is that they create a pool of live, open connections that an application can draw from. The cost of opening connections is paid once and amortized over all the requests made.
    That makes me think that I should leave connections open.
    When I do database access with Tomcat, I set up a JNDI connection pool. I have my apps close every ResultSet and Statement, but I don't close the connections. I leave them open to be put back in the pool for the next request to use.
    Is this correct? - MOD

  • Multiple cursors opened when following BC4J Entity Association in a loop

    I am using BC4J in JDeveloper 9.0.4.1.1 Build 1436 against a 9.0.2 database.
    (Note the BC4J project was originally created in a 9.0.3 JDeveloper release)
    In the BC4J project, I have a "Contract" Entity that has a 1-to-1 Association with an "Estimate" Entity.
    From my ViewObject, I iterate over a set of Contracts.
    For each Contract, I follow the Association to obtain the Estimate and read a few attributes.
    Occassionally I am running out of cursors in the database whilst using this.
    It seems that each time I access an Estimate using the Association, a new cursor is opened to retrieve the Estimate. These cursors remain open until I complete the loop and the cursor for the VO is closed.
    Therefore, the maximum number of rows returned by the ViewObject is limited to the number of available cursors in the database at the time.
    Why do the cursors remain open after the Entity object has been retrieved?
    Am I using the association incorrectly?

    I wouldn't surprise me if there was a bug in the association code like this.
    For the time being you could just set the where clause and do the query yourself manually on the child vo....

  • PL/SQL leaves cursors open?

    I have been researching into what might look like a resource drain in an Oracle 7.3.4 database we have on a SCO OpenServevr 5.0.5 server.
    There are a couple of applications written in PRO*C (compiled on Solaris with Oracle 8.1.5) always running that keep connections open to the DB. All exchange of data between the apps and the db happens via calls to stored procedures.
    Examining the state of the connections, I noticed that the number of open cursors and UGA/PGA memory used seems to increase over time, and never stabilizes.
    I experimented a bit and noticed that even if I open a session via SQL/PLUS and call an extermely simple procedure that opens a cursors, fetches it, closes it and then commits, the cursor remains open until the session is closed (I examined the session with Toad and Enterprise manager - and cursor cache count is set to 0). Is the open cursor consuming resources (e.g. using precious ram of the SGA) even after the procedure is ended? And if so, how can I release a maximum of resources when my applications are idle, without having to close and reopen the session?
    Thanks, Gaetano Giunta

    If the open cursors are too many then
    ALTER SYSTEM SET CURSOR_SHARING = FORCE;
    Works only with oracle9i
    uv to set ur initparam CURSOR_SHARING=FORCE.
    Which will try using bind variables only.
    Check docs on cursor_sharing may be u may get fair idea on bringing down cursor openings....

  • Cursor size limited to 32x32?

    Hi,
    I'm trying to implement a custom cursor on my DnDTable, and the idea is that it must display the name of the dragged object.
    I already found out how to change the cursor to one of my own (Toolkit.createCustomCursor()), but the problem is that I can't resize the cursor.
    I want it to be at size (120, 10), and it seems I can't change the default size of the cursor.
    Anybody knows how I can change a cursor to a bigger one of my own??
    Thanks in advance!
    Gerben

    What do you mean? I use this method to start dragging:
    void startDrag(DragGestureEvent trigger, Cursor dragCursor, Transferable transferable, DragSourceListener dsl)
    The cursor is one of the default or system cursors, or the one created by myself with this method:
    Toolkit.createCustomCursor(Image cursor, Point hotSpot, String name)
    which returns a Cursor object. I draw a string in the BufferedImage in order to display the DataObjects name.
    But, because it seems the OS limits cursors to a maximum size of 32x32, I just can't get my Image larger than 32x32. So I'll have to hide the cursor and draw a whole new (and bigger) component over it.
    Am I going wrong somewhere here? If there's any other way, I'd love to hear it!!

  • FF4 problems - bookmark multiple tabs, cursor, open in new tab

    What's happened to being able to bookmark multiple tabs - I don't need it often but it's really useful when I do. I can't find it in FF4.
    I'm having a problem with my webmail. I used to access the password field with a single click, now I have to click twice before the cursor is active. I run into this problem multiple times a day.
    Open link in new tab: in FF4 I keep opening a new window by mistake - it's really annoying. Why was the position of this command changed in the shortcut menu. I use the command many times a day and my brain is too old to adapt easily.
    Likewise the refresh button has moved. I use this button countless times a day - it's really annoying to find that I can no longer automatically refresh a page.

    The reload button is now on the end of the location bar (where you type web addresses ) by default. It isa stip button whilsta page loads, and a reload button after a page has loaded. There are also options to use completely separate reload and stop buttons, or to add a button to the toolbar that changes between the stop and reload functions.
    The changes may be made without adding any extension, the option used to be called customise (in my en-uk) or customize (en-US) and is now available from
    * Firefox Button -> Options -> toolbar layout ...
    * or by right clicking an empty space on a toolbar
    Note the order of the buttons determines whether it displays as a merged button, or as separate stop and reload buttons.

  • Hovering cursor opens application?

    My Music Director at church has a new Macbook Pro running Snow Leopard and wants to know why applications open when he leaves the cursor setting over the icon in the dock but does not click on it? Is there a setting to turn this feature off.

    Are you sure that you haven't activated the trackpad for tapping?

  • JDBC & Open Cursors

    Hi,
    Could it be possible that even if all ResultSet and Statement objects are closed (in finally blocks so that the close() statements are guaranteed to be executed), one can still get ORA 1000 or max open cursors exceeded? Is there a bug in JDBC that makes the cursors linger even though they have been closed by the program? I ask this because a colleague of mine insists that there is such a JDBC bug and that the only workaround is to close the Connection object. He also claims that the "bug" is fixed in Oracle 9i. We are using Oracle 8.1.7.0.0 on HP-UX 11.0 with java 1.3.1 Any info greatly appreciated. Thanks.
    Vasu

    Max cursors open, is the problem encountered because of the database limitation of opening of new sessions. A new database session is created whenever a Statement/PreparedStatament is opened.
    Make sure to close, Statement/PreparedStatement after its usage, as you have done in finally. This will ensure that it wont exceed the maximum open cursor limit.
    I think this is the only cause for the baove problem and can be avoided.
    Hope this helps
    Ravi

  • OPEN cursor for large query

    OPEN cursor
    When you OPEN a cursor for a mult-row query, is there a straightforward way that you can have it only retrieve a limited number of rows at a time and then automatically delete those rows as you do the FETCH against them? I'm thinking of setting up multiple sequential cursors, and opening and closing them as the rows are processed. But I'm hoping there might be a better way.
    The problem is that I'm running out of TEMPORARY during the OPEN cursor stage.
    The application I am working on needs to work in Standard Edition and Personal Edition versions of Oracle.
    Thank you.

    Thanks - I had read the documentation before, but interpreted it differently.
    What I had read was in:
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14261/sqloperations.htm#i45288
    The extract of interest was:
    Opening a Cursor
    Opening the cursor executes the query and identifies the result set, which consists of all rows that meet the query search criteria. For cursors declared using the FOR UPDATE clause, the OPEN statement also locks those rows. An example of the OPEN statement follows:
    DECLARE
    CURSOR c1 IS SELECT employee_id, last_name, job_id, salary FROM employees
    WHERE salary > 2000;
    BEGIN
    OPEN C1;
    Rows in the result set are retrieved by the FETCH statement, not when the OPEN statement is executed.
    My interpretation was that the result of the query was put into the temporary tablespace and then retrieved into the program during the FETCH.
    Assuming I was wrong, what I'm wondering now is how I can possibly be running out of temporary space during this OPEN cursor process.

  • Open cursors and shared cached cursors

    Hi
    In addm report i found below recommendation, before any change in parameter i want to know about those parameters, is there any thumb rule for this parameters,
    is there any drawback if i increase those parameters.
    FINDING 7: 2.1% impact (10693 seconds)
    Soft parsing of SQL statements was consuming significant database time.
    RECOMMENDATION 1: Application Analysis, 2.1% benefit (10693 seconds)
    ACTION: Investigate application logic to keep open the frequently used
    cursors. Note that cursors are closed by both cursor close calls
    and
    session disconnects.
    RECOMMENDATION 2: DB Configuration, 2.1% benefit (10693 seconds)
    ACTION: Consider increasing the maximum number of open cursors a
    session
    can have by increasing the value of parameter "open_cursors".
    ACTION: Consider increasing the session cursor cache size by
    increasing
    the value of parameter "session_cached_cursors".
    RATIONALE: The value of parameter "open_cursors" was "300" during the
    analysis period.
    RATIONALE: The value of parameter "session_cached_cursors" was "20"
    during the analysis period.
    Thanks and Regards
    Jafar

    Jaffy
    Your system suffers from soft parsing (according to ADDM), therefore:
    - Increasing the value of open_cursors has no impact on soft parsing (only up to 9.2.0.4 open_cursors had a direct impact on that for PL/SQL programs).
    - Increasing the value of session_cached_cursors might help reducing soft parsing. If it helps or not is really dependent from the application.
    ADDM is probably advising to increase open_cursors as well, because the database engine will keep cursors open even if the application closes them.
    HTH
    Chris
    PS: cursor_sharing might be helpful to reduce hard parses. It has no impact on soft parses... So, forget the hint about it.

  • Cursors remained open after closing connection

    I am using OC4J 10g (Application Server) and Oracle10g DB. OC4J is maintaining the connection pool(com.evermind.sql.DriverManagerDataSource). I get the connection from pool and call DB procedure, then close resultset, statement and connection. It closes the opened cursors against resultset. But left some implicit cursors opened and never closed so cursor count is going to increase.
    If i dont use pool no cursor remained open and count is zero. It means the cursors of pooled connections are not closed.
    wait-timeout="60"
    min-connections="5"
    max-connections="100"
    inactivity-timeout="15"
    <property name="stmt-cache-size" value="2000"/>
    Tahir

    Hi Justin,
    Thnx for your reply and you're understanding is correct but the problem I face is when multiple concurrent users access the JSP page from which I'm actually calling the servlet to retrieve the image, the number of cursors being left open increases. As the load on the page increases (i.e. no of usesrs increase) oracle seems to have problems in garbage collecting the open cursors ... which eventually leads it to throw maximum cursors exceeded exceptions.
    Any suggestions ?
    -Athar

  • Viewer leaving open cursors in Oracle

    We are using the JRC to display reports in our software. We are running jboss-4.2.0 as our application server. The backend could be either SQL Server or Oracle. For Oracle we are using the oracle.jdbc.driver.OracleDriver driver. The reports are set up using a JDBC (JNDI) connection. Generally we have it working ok but in Oracle the JRC is leaving open cursors leading to  ORA-01000: MAXIMUM OPEN CURSORS EXCEEDED. I have found that a new cursor is opened when the data source is changed in the following code snippet
    Iterator tableIT = tableNames.iterator();
    while (tableIT.hasNext()) {
      ITable oldTable = (ITable)tableIT.next();
      ITable table = (ITable) ((IClone)oldTable).clone(true);
      table.setQualifiedName(table.getName());
      clientDoc.getDatabaseController().setTableLocation(oldTable, table);
    When we hit the last line in this loop, a new cursor is opened in Oracle so if a report has 10 tables, I get 10 cursors opened. I know that I need to close the cursors somehow but nothing I do seems to make a difference. After my processHttpRequest call to the viewer I added:
    crystalReportPageViewer.getReportSource().dispose();
    clientDoc.getReportSource().dispose();
    The code definately executes but the the number of open cursors in Oracle does not change. I am at a loss.

    A couple more things to think about then.
    1.  When you go through your loop to set your table location, you are using the clone method to create a new table and then pass that table to the report.  Cloning tables is no longer necessary with the JRC.  We do know that a fix was provided for the JRC SDK, however this fix would probably not have been applied to the clone method since it has been deprecated.
    I have attached a sample that shows the new methodology for setting table location; very similar, just not using clone anymore.
    2.  When you want to destroy any connections that the ReportClientDocument has made, you will need to call .close() on this object.  This can be done in conjunction with the viewer.dispose().  One thing to note is that if you call the .close() method, it will need to be done as the user is closing the browser, or you will not have access to your report object when you have it open in the HTML Viewer.

  • Maximum open cursors exceeded - special case scenario

    Im sorry if I am asking the same old question but I assure you I have done a lot of research and tried everything I can think of. I have done a search on this and found hundreds of sites with solutions to this problem I still cant seem to get it to work. My code is a bit different from most examples though so Im wondering if mine just needs a special solution.
    What I have is a java server (with multiple threads) that makes all the database connections from a static class. This class' methods are synchronized, and instead of making multiple statement and resultsets, I have only one global for each so I can avoid having to close them from the server. Otherwise I would have to return the resultset to the server and then have the server make a class call to close the statement and the resultset. (This might be my problem right there). But I close all my resultsets on the server end so Im not really sure where the problem is.
    Since I only have one resultset and one statement then I shouldn't need to close it right? Any help would be greatly appreciated.

    close all your result sets and statements and such. you are getting this exception because you are not closing all these things and leaving these cursors open.

Maybe you are looking for