ORA-1000 OCCI C++ urgent

Hello
I have a problem
I have an Environemnt in which I execute x times a stored PL/SQL procedure
Environment *env = Environment::createEnvironment();
          Connection *conn = env->createConnection(uzytkownik->zwroc_login(),uzytkownik->zwroc_haslo());
for (int x=0,x<10000;x++)
Statement *stmt = conn->createStatement();
          stmt->setSQL("begin execute_my_procedure;end;");
          stmt->executeQuery();
env->terminateConnection(conn);
Environment::terminateEnvironment(env);
I have an error ORA-1000
what to do??
when I in for loop create an environment , call my procedure and terminate environment everything works fine, but it's not effective becauese every time I connet to database and disconenct
please help
Marcin
[email protected]

In the loop, you need to terminate the statement and free the cursor on the server. Please add inside in the loop :-
conn->terminateStatement(stmt);
Ofcourse, if you are planning to execute the same SQL repeatedly, you can just execute the already created Statement and not create/prepare a new Statement.
Thanks,

Similar Messages

  • Ora-1000 max openCursor exceeded

    Hi,
    i have a question about the ora-1000.
    My prog is a "C"-coded Programm. Which is connected to the
    database. After few days the Ora-message ora-1000 will be shown
    in the tracefile.
    The Parameter Max open Cursor is meanwhile set 1000.
    Knows anyone the Problem with 8.1.7 DB.
    We have also the online-backup and the Journaling set on.
    I tried to generate the same fault with a test prog but it was
    not possible with test- Tables. I had the same effect only with
    the Production Tables.
    bestv regards

    Make sure that u close all the cursors that u open in the
    program. Most of the time that is the biggest culprit.
    Ketan.

  • Using PreparedStatement and the Oracle Error ORA-1000

    Hi,
    I have a question about PreparedStatement objects that is not so simple to explain for me. What I would like to know is: if I use a PreparedStatement following traditional and generic steps:
    1- PreparedStatement pStmt = Connection.prepareStatement(sQuery);
    2- pStmt.setXXX(i,j);
    n - pStmt.setXXX(i,j);
    n+1 - ResultSet rs = pStmt.executeQuery();
    n+2 - while(rs.next()){ ... retrive ResultSet data  ... }
    n+3 - rs.close()
    n+4 - back to point number 2
    and at the end (as you can see in the point numbered n+4), instead of closing the PreparedStatement pStmt using the close() method, I reuse the PreparedStatement pStmt comeing back to the point numebr 2 and setting again all its parameters with new values ... then ... what heppens in the Oracle database ? Has been the cursor (so the mamory area), associated to my PreparedStatement object pStmt, duplicated or is it the same ?
    I know that Java allows you to do this kind of operations with PreparedStatement, and I know that in tha Java Documentation is explained to follow this strategy to optimize the execution time because in this way the same PreparedStatement is precompiled and prepared only once. But if I do a for loop following the steps explained before, after many iterations I have the error "ORA-1000: maximum open cursors exceeded". This error is the reason of my question. Does this error means that it's mandatory to close a PreparedStatement always, otherwise if you reuse it without closing it then the corresponding database cursor will be duplicated ? If it is so, then I think this is a contradiction with official java documentation ...
    I'm using Oracle8i (version 8.1.7) and Oracle JDBC Thin Driver (Windows NT) for use with JDK 1.2.x. Moreover, in my database istance the parameter "maximum open cursor" is equal to 800 ...
    Thank you very much for suggestions :-)

    There is no need to close a prepared statement or its resultset for every iteration.
    After the first iteration in a loop, all subsequent executions of it will close the previous resultset. By adding close() method, you are making one extra costly call to the DB for no reason.
    Following is the sample code.I know what you are saying. In fact at the beginning I wrote my code in the same way of your sample (see the code of my first post at the begin of this page).
    But doing so, after thousand iterations of the loop, I had "Oracle Error ORA-1000 : maximun open cursor exeeded" even if in my database istance the parameter "maximum open cursor" is equal to 8000.
    At this moment in my code, for each iteration, I close the PreparedStatement and in this way I don't have anymore the error :-((
    So it seems that only in theory we can reuse a preparedStatement without closing it. In fact if we see the oracle system table "$open_cursor" (as Konrad Pietzka suggest me) we can find that, for each interation,
    at our line code "rs = pstmt.executeQuery();" correspond a new cursor in the database: this means that for each method "pstmt.executeQuery()" the database open a new cursor and do not use the previous one as it should.
    I posted a question two months ago to search if someone had the same problem (it seems that Konrad Pietzka had the same situation) and was able to explain me what is the cause.
    The only reason I found by myself for this problem, is that probably the Oracle JDBC Thin Driver for Windows NT/2000 has some bugs... but I'm not sure ...
    Thank you very much for you time !!
    bye :-))
    Fidalma

  • TABLE, PACKAGE, USER가 DROP되지 않을 때의 조치 방법(ORA-1000)

    제품 : ORACLE SERVER
    작성날짜 : 2004-11-09
    TABLE, PACKAGE, USER가 DROP되지 않을 때의 조치 방법(ORA-1000)
    ============================================================
    다음 자료는 dropping an object (table, package, users) 시에
    ora-1000 또는 internal error 가 발생하며 drop 되지 않을 때의 조치
    방법입니다.
    internal 자료로서 엔지니어가 직접 알려주는 것이 좋다고 remark 되어 있는
    자료입니다.
    요약>
    drop package 시에 ora-1000 은 다음 자료 처럼 drop 하려는 object 와
    dependency 는 남아있지만 invalid object(no interdependant objects
    즉, children which are also parents) 가 존재할 때 발생합니다.
    따라서, drop 하려는 object 의 dependency 를 조회하여 invalid object
    와의 dependency 를 dependency$ 에서 지워줍니다.
    주의!>
    다음 작업을 수행 도중 dependency$ 의 row 를 삭제하기 전에는 반드시 cold
    backup 을 해 주십시오.
    <table, package, user 를 drop 할 때 Ora-1000(ORA-604) 이 발생하는 문제 조치
    방법 >
    Object 를 drop 할 때 ORA-1000 과 같은 에러가 발생하여, open_cursors
    를 1000 이상으로 늘여도 계속 에러가 발생할 때는 다음과 같이 원인을
    찾아 제거 합니다.
    1. drop 하려는 object 의 parent dependency 를 찾는다.
    svrmgr> connect internal;
    select lpad(' ',2*(level-1))||p_obj#,d_obj#
    from sys.dependency$
    where p_obj#=(select a.obj# from sys.obj$ a, sys.user$ b
    where a.owner#=b.user#
    and a.name='PROCEDURE1' and b.name='SCOTT')
    connect by prior d_obj#=p_obj#;
    2. drop 하려는 object 의 child dependency 를 찾는다.
    select lpad(' ',2*(level-1))||p_obj#,d_obj#
    from dependency$
    where d_obj#=(select a.obj# from obj$ a, user$ b
    where a.owner#=b.user#
    and a.name='PROCEDURE1' and b.name='SCOTT')
    connect by prior p_obj#=d_obj#;
    3. 위에서 조회된 모든 object 가 dba_objects 에 존재하지 않거나 status 가
    invalid 인 것을 찾는다.
    select * from dba_objects where object_id=xxx;
    4. 1 의 조회 결과와 2 의 조회 결과에 의해 동시에 발견된 object id 가
    있는지 확인한다.
    5. 위의 3 의 조회 결과 object 가 존재하지 않거나 invalid 인 것 ,
    4 의 결과 동시에 발견된 object id 가 있다면 cold backup 을 먼저 받아둔다
    6. valid 한 backup 이 있다면, sys user 로 접속하여 이들 row 를 다음과 같이
    delete 한다.
    다음을 먼저 select 한 다음, valid 한 backup 이 있는지 확인한 다음
    delete 해야 한다.
    즉, 두개의 object 가 서로를 의존하고 있는 것이므로, 두개의 row 를 삭제한다.
    다른 row 가 delete 되지 않도록 먼저 query 해 본다.
    예) procedure (contact) -> package (dbwww) 그리고 package (dbwww) ->
    procedure (contact) 인 경우
    1)select * from dependency$
    where d_obj#=(select object_id from dba_objects
    where owner='....'
    and object_type='PROCEDURE'
    and object_name='CONTACT')
    and p_obj#=(select object_id from dba_objects
    where owner='....'
    and object_type='PACKAGE;
    and object_name='DBWWW')
    and d_owner#=(select user_id from dba_users
    where username='...');
    2)select * from dependency$
    where d_obj#=(select object_id from dba_objects
    where owner='....'
    and object_type='PACKAGE'
    and object_name='DBWWW')
    and p_obj#=(select object_id from dba_objects
    where owner='....'
    and object_type='PROCEDURE';
    and object_name='CONTACT')
    and d_owner#=(select user_id from dba_users
    where username='...');
    3) alter system flush shared_pool;
    4) delete from dependency$
    where 위의 1),2) 같음;

  • ORA-29516 Need an urgent help

    Hi Gurus,
    When trying to call dbms_java package i am getting the following error:
    Exception in runStoredProcedure: ORA-29516: Aurora assertion failure: Assertion failure at eoxdebug.c:93
    jonzf_get_zip_message is not yet implemented
    oracle version 10.2.0.1.0
    Please help....
    saby

    Also also, read the metalink note 466315.1.
    Nicolas.Thanks Nicholas....metalink note was very usefull...

  • Parameters of Init SID .ORA ???URGENT

    Hi
    I have an Oracle 8.1.7 on Windows2000 with 640MB RAM.The Oracle home in D:\ drive and initial paging size on C:\ =960MB and Maxi. = 1920 MB
    and the total paging file size is 960MB.
    No. Of users 15.
    SO I want PLS the parameters of the Init<SID>.ORA of this database specialy things regarding to RAM,SGA,Sahred_Pool_size and memory.

    Hi
    I have an Oracle 8.1.7 on Windows2000 with 640MB RAM.The Oracle home in D:\ drive and initial paging size on C:\ =960MB and Maxi. = 1920 MB
    and the total paging file size is 960MB.
    No. Of users 15.
    SO I want PLS the parameters of the Init<SID>.ORA of this database specialy things regarding to RAM,SGA,Sahred_Pool_size and memory.And how can I set the db_block_buffers,Block_Buffer and Log Buffer. You can use the following parameters, depends on what you like to have:
    log_buffer = 32768 # small
    log_buffer = 262144 # medium
    # block buffers = (db_block_buffers * db_block_size ) = 10MB small , 50 MB medium, >100MB big
    db_block_buffers = ? see formula above
    shared_pool_size = 20000000 # small
    shared_pool_size = 50000000 # medium
    # you can set these to 0 when you don't you use MTS or JAVA (I recommend to uncommend all MTS* parameters)
    large_pool_size = 0
    java_pool_size = 0
    # small sort area sizes
    sort_area_size = 65536
    sort_area_retained_size = 65536
    Cheers
    Thomas

  • Proboem migrating ora 8i to 9i - URGENT!!

    hi folks.
    I have a box thata has iis and ora 8i installed.
    I had to migrate oracle to 9i version DB, so I started 9i installation.
    It was everything fine when, during the installation, asp pages crashed with following error:
    ORA-01041: internal error. hostdef extension doesn't exist </Description><Source>Microsoft OLE DB Provider for Oracle
    Did anyone had this problem? IIS connects with no errors to Oracle DB that is running on Oracle 8.1.7
    THANK YOU VERY MUCH FOR ANY HELP!
    Alex

    hi folks.
    I have a box thata has iis and ora 8i installed.
    I had to migrate oracle to 9i version DB, so I
    started 9i installation.
    It was everything fine when, during the installation,
    asp pages crashed with following error:
    ORA-01041: internal error. hostdef extension doesn't
    exist </Description><Source>Microsoft OLE DB Provider
    for Oracle
    Did anyone had this problem? IIS connects with no
    errors to Oracle DB that is running on Oracle 8.1.7
    THANK YOU VERY MUCH FOR ANY HELP!
    AlexDid you migrate Database seccessfully or not?
    Did you try to use sqlplus to connect to new database?

  • Ora-01034 error. URGENT

    my oracle database is having around 1500000 records. oracle was working fine previous day. but not it is giving error ora-01034 "oracle not available". what might be the problem . Please any one tell the remedy.

    might be your database is not up have you checked the database ,checked the environment variable is properly set and start the database again.

  • Ora-00604 error and ora 01000 error while report generation.

    hi all,
    I am trying to generate the multiple reports of same template through a program.
    While this job is running, i get the following error at the BIP console and the reports don't get generated.
    [101711_044115578][][EXCEPTION] java.sql.SQLException: ORA-00604: error occurred
    at recursive SQL level 1
    ORA-01000: maximum open cursors exceeded
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01000: maximum open cursors exceeded
    ORA-01000: maximum open cursors exceeded
    Kindly help.
    Thanks.

    Lots of resources with a simple search to see what this is about, for example:
    http://www.orafaq.com/wiki/ORA-01000
    ORA-01000:     maximum open cursors exceeded
    Cause:     A host language program attempted to open too many cursors. The initialization parameter OPEN_CURSORS determines the maximum number of cursors per user.
    Action:     Modify the program to use fewer cursors. If this error occurs often, shut down Oracle, increase the value of OPEN_CURSORS, and then restart Oracle.
    open_cursors parameter
    http://download.oracle.com/docs/cd/E11882_01/server.112/e25513/initparams160.htm#REFRN10137
    Oracle support note:
    OERR: ORA-1000 maximum open cursors exceeded (Doc ID 18591.1)

  • Unexpected "ORA-01001: invalid cursor" error

    I have a Pro*C application that basically fetches from a cursor, does a bunch of work with that row, does a "delete from <table> where current of <cursor name>", then loops back, fetches, the next row, etc., and finally closes the cursor once all the rows have been processed.
    One of our clients is getting an 'ORA-01001' error on the "DELETE FROM <table> WHERE CURRENT OF <cursor>" statement. This is long-standing, frequently executed code at 100+ clients and I've never had a problem with this statement before. The client is consistently getting this error on a particular row from this cursor, but other rows processed with the same cursor are processing successfully.
    Unfortunately, I do not have direct access to the client's database, so I cannot debug directly, but I've placed print statements around the only place in my application's code that explicitly closes the cursor. A log generated on a run that threw the 1001 error confirmed that the cursor is NOT being explicitly closed by my application by an "EXEC SQL CLOSE <cursor>" statement.
    Likewise, I put print statements around all the COMMITs and ROLLBACKs in my application, and none of these showed in the logs either.
    My application does make a call to a client-customized PL/SQL function that they recently changed. However, I have a copy of the clients function and there are not any explicit COMMIT, ROLLBACK, ANALYZE, ALTER, DROP, REPLACE, TRUNCATE or CREATE statements that would implicitly commit and close the cursor.
    Here are potential problems that I have ruled out:
    -Oracle OPEN_CURSORS parameter - It appears that if this were the problem, the error would be an ORA-1000, not 1001. Please correct me if I am wrong here.
    -Pro*C MAXOPENCURSORS parameter - I compiled a version with a MAXOPENCURSORS value that is higher than the client's OPEN_CURSORS setting. If this were the problem, the error should have switched to the ORA-1000 error when I increased the parameter. It remained as an ORA-1001.
    Next steps:
    -What could cause a cursor to close other than explicit COMMIT, ROLLBACK, ANALYZE, ALTER, DROP, REPLACE, TRUNCATE or CREATE statements?
    -Is there anything I can run, such as a database trace, that will show me exactly when the cursor is being closed? I admittedly don't know a lot about DB traces.
    -Anything else I should check? Any other information I should provide?
    Thanks ahead of time for any help!

    Chandrakaanth Ramamurthy wrote:
    Does the client customized PL/SQL block contain EXIT
    Exit will end up issuing a commit and hence this could be an issue.Exit is not used in the customized function.
    Chandrakaanth Ramamurthy wrote:
    Also please check that commit and roll back are placed at the end of the loop.The only commit/rollback is after the loop is over is finished.
    I actually just figured out the issue. Turns out the cursor just hadn't been opened due to a very unique data condition... facepalm You know what happens when you assume things, right? :)
    Thanks for the help anyway!

  • ORA-01000: maximum open cursors exceeded ORA-06512

    Hi,
    An exception error ccurred as below while trying to map a column.
    Exception oracle.apps.bne.exception.BneSQLException: SQL Exception in BneFlex.validateSegs: java.sql.SQLException: ORA-01000: maximum open cursors exceeded ORA-06512: at "APPS.FND_MESSAGE", line 525 ORA-06512: at "APPS.FND_MESSAGE", line 565 ORA-06512: at "APPS.FND_MESSAGE", line 654 ORA-06512: at "APPS.FND_MESSAGE", line 766 ORA-06512: at "APPS.FND_MESSAGE", line 741 ORA-06512: at "APPS.FND_FLEX_KEYVAL", line 324 ORA-06512: at line 1 occurred trying to map column: Expense Account.
    In alert log file:
    Errors in file /vol01/oracle/SIT/db/tech_st/10.2.0/admin/SIT_sit/udump/sit_ora_7
    04744.trc:
    ORA-07445: exception encountered: core dump [] [] [] [] [] []
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01000: maximum open cursors exceeded
    ORA-01000: maximum open cursors exceeded
    Thanks
    Edited by: userpat on Aug 15, 2010 5:32 AM

    Hi,
    The issue is different this time after restarting application and database find below.
    An exception occured trying to map a column
    Exception java.lang.ArrayIndexOutOfBoundsException:Array index out of range:1
    occured trying to map column:Category
    in bne.log
    8/18/10 12:08 PM AJPRequestHandler-ApplicationServerThread-2 ERROR BneP
    arentMenuResolver.getMenuItem() MENU 101:BUDGET_NOTE - Menu item excluded becaus
    e IntegratorAppId and Code does not match that of the Top-Most Menu Item or curr
    ent Integrator: 140:FA_MASS_ADDITIONSThe same error is reported in Note: 954462.1 (which is referenced above).
    And also let me clear one doubt. v$open_cursors view is used for what?. The total number of count v$open_cursors is 60,000 whereas the parameter is defined only 2000 in the Instance.Cursors Remain Open (in V$OPEN_CURSOR View) after being Closed [ID 1020427.102]
    Monitoring Open Cursors & Troubleshooting ORA-1000 Errors [ID 76684.1]
    V$OPEN_CURSOR
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2008.htm#REFRN30166
    Thanks,
    Hussein

  • ORA-01000: maximum open cursors exceeded with Thin and OCI

    Hi I have this ERROR :
    ORA-01000: maximum open cursors exceeded
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at line 1
    and all the connections show this error, I run the weblogic.Admin RESET_POOL utility
    and the problem are fixed !!
    Why show this error ?
    why with RESET_POOL utility resolve the problem ?
    the Oracle Version is Oracle 8.1.7.0 32bits on Solaris 8

    Mitesh:
    I using testConnOnReserve=true and testReleasedConnections=true specify testTableName
    when the errors appear , but increse the open_cusror value to 1200, i think is
    not the solution, because the DB and Stored Procedure is used by Cold Fusion ,
    is the same Application, in Cold Fusion not show this error u other errors with
    380 users on the application.
    I check to increse the open_cusror and test the application.
    thanks
    Roberto
    Mitesh Patel <[email protected]> wrote:
    You should do couple of things here.
    First of all you can increse the open_cusror value to 1200 if it is ok
    with you.
    Secondly, make sure you are using testConnOnReserve=true and specify
    testTableNAme
    in your config.xml for your connection pool defination.
    Thanks,
    Mitesh
    Roberto Hernandez wrote:
    Mitesh Patel,
    WLS 6.1 sp3 on Solaris 8, in init.ora file
    session_cached_cursors = 30 and Open_Cursors = 600
    Any Idea to resolve the Error and not use manual RESET_POOL utility?
    thanks
    Mitesh Patel <[email protected]> wrote:
    This is know bug from oracle.
    XAResource.recover repeatedly returns the same set of in-doubt
    Xids irrespective of the input flag. According to the XA spec, the
    Transaction Manager should initially call XAResource.recover with
    TMSTARTRSCAN and then call XAResource.recover with
    TMNOFLAGS repeatedly until no Xids are returned. This Oracle
    bug could lead to infinite recursion and subsequent running out
    of Oracle cursors with error "ORA-01000: maximum open cursors
    exceeded."
    What version of weblogic are you using? What is value for max cursors
    in init.ora file
    in your dbserver?
    Resets the named database ConnectionPool by shutting down and
    reestablishing all the allocated connections. This method should
    only be called when the connection pool is known to be in a bad
    state, for example when the database has been restarted.
    By using Reset you are cleaning all bad connections and associated
    cursors
    with it. That
    is why it resolves ora-1000 for you.
    Mitesh
    Roberto Hernandez wrote:
    Hi I have this ERROR :
    ORA-01000: maximum open cursors exceeded
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at line 1
    and all the connections show this error, I run the weblogic.Admin
    RESET_POOL
    utility
    and the problem are fixed !!
    Why show this error ?
    why with RESET_POOL utility resolve the problem ?
    the Oracle Version is Oracle 8.1.7.0 32bits on Solaris 8

  • Help with "alter system set events = '1000 trace name ERRORSTACK level 3'"

    Hello.
    I am trying to find out wich sql code is creating the error ORA-01000 in my application (database release is 9.2.0.7). I have read this http://www.orafaq.com/node/758 and there they suggest doing this:
    Sometimes you will need to get a full stack trace of the problem by setting a trace for ORA-1000 as in:
    alter system set events = '1000 trace name ERRORSTACK level 3'
    or...
    alter session set events = '1000 trace name ERRORSTACK level 3'
    Then set open_cursors to a low enough number to catch the open cursor voilator in your net.I have no idea about this traces, so these are my questions:
    1. Do those commands force a trace every time the ORA-01000 errors rises in every session? (I have forced the ORA-01000 error in one sqplusl session after I wrote "alter session set events = '1000 trace name ERRORSTACK level 3'" in another sqlplus session)
    2. What does level 3 mean?
    3. I see that in the dump/user directory I have several trace files, how can I know which error traces are enabled in my db?
    4. How do I disable the traces once I find out to solve the problem?
    5. How do I identify in the traces the ORA-1000 error?
    Thanks in advance.

    Thanks for all the answers.
    What am I doing bad? I have tried ti find out what traces are enabled, and there seems to be none.
    SQL> r
      1  DECLARE
      2     OUT   BINARY_INTEGER;
      3  BEGIN
      4     DBMS_OUTPUT.put_line ('Init');
      5
      6     FOR i IN 1 .. 20000
      7     LOOP
      8        SYS.DBMS_SYSTEM.read_ev (i, OUT);
      9
    10        IF (OUT <> 0)
    11        THEN
    12           DBMS_OUTPUT.put_line ('i: ' || i || '; ' || OUT);
    13        END IF;
    14     END LOOP;
    15
    16     DBMS_OUTPUT.put_line ('End');
    17* END;
    Init
    EndBut, otherwise, there are trc files which have been modfiied recently? I seems as if this procedure can't detect all the tracles enabled:
    (oracle)mano1re(principal)$ ls -lt *.trc | more
    -rw-r-----   1 oracle   dba       348294 jul 14 18:35 reflex_ora_11706.trc
    -rw-r-----   1 oracle   dba       997820 jul  9 16:32 reflex_ora_15766.trc
    -rw-r-----   1 oracle   dba       399571 jul  3 15:23 reflex_ora_25955.trc
    -rw-r-----   1 oracle   dba      1637069 jun  9 15:34 reflex_ora_19742.trc
    PL/SQL procedure successfully completed.

  • 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

  • Disposing RefCursor does not close RefCursor?

    Hi,
    I want to dispose the OracleRefCursor after executing the executedatatable command. To achieve this, i tried to dispose the OracleRefCursor object but it did not close the cursor, i saw the related cursor in v$open_cursor table. So how can i close the opened cursor without closing the connection or committing or rollback? Thanks...
    The code that i tried to close cursor is:
    OracleParameter m_Cursor = m_Command.Parameters["pCursor"];
    m_Cursor.Dispose();
    It did not work.

    Hi,
    According to AskTom the fact that you see it in v$open_cursor doesnt mean it's necessarily open.
    Are you seeing a problem as far as ORA-1000 that you're trying to troubleshoot for example? Or is this just something you noticed?
    Thanks
    Greg

Maybe you are looking for

  • Is there a way of preventing q10 from creating PC contacts

    I use gmail contacts as Imap in q10 When I sync these with my outlook, BB creates a separate list called PC contacts So under contacts I have: 1. All 2. Favorites 3. Groups 4. BBM 5. Gmail 6 PC I actually wnat only one list, I want to remove all the

  • Software 2.0 : no audio after using USB accessory

    I've discovered what I believe is a rather interesting (and rather serious) bug in the iPhone 2.0 software: When an USB IAP accessory (such as a lot of newer car stereos) is connected and disconnected a couple of times the audio output from the iPhon

  • Display wont wake-up on Windows 8.1 iMac (ATI HD 5750)

    I've just installed windows 8.1 and now I'm having a strange problem: When the display goes into standby I cannot wake it back up, the machine is still awake as I can RDP in.. It appears windows is replacing my good display driver with one that it th

  • I have an unwanted quicktime movie playing in the background.

    I was watching a youtube iMovie video.  I quit QuiickTime Player, but a little later it started to play again. It is still playing, but QT Player is not running. I have checked every browser tab I have open. I have checked Finder and it is not showin

  • Health Check Program?

    With what program you guys monitor the health condition of external hard drives? (Sony HD-E1 2.5" 1 TB External Hard Drive)