Open_cursor ,cursor_sharing..

plz i need the details abt open_cursor ,curssor_sharing .....parameters.. ..in detail

open_cursor - number of cursors referencing private sql area allocated to user process.
cursor_sharing- can help the users share the parsed code
regards

Similar Messages

  • Question related to cursor_sharing

    Hi all,
    We have a Oracle 9.2.0.6 on sun box.....
    I would like to know what should be the value of cursor_sharing?
    Currently we have a value
    SQL> show parameter cursor
    NAME                                 TYPE        VALUE
    cursor_sharing                       string      EXACT
    cursor_space_for_time                boolean     FALSE
    open_cursors                         integer     2000
    session_cached_cursors               integer     0
    SQL>our application is using literals....
    if i would set cursor_sharing=similar,will the performance improved or not...
    Edited by: user00726 on Mar 9, 2009 3:09 AM

    setting cursor_sharing = similar might help, it depends oin the application, if you are suffering from a lot of hard parses then yes it may help however there may be side effects esspecially if your database is mixed workload and you are runnning a mix of OLTP and Data Warehouse stuff.
    Overall you need to test it and find out what hte side effects are first.
    Chris

  • Problemas com o CURSOR_SHARING = SIMILAR

    Olá,
    Sou DBA de uma empresa que utiliza o Oracle 10G, e recentemente realizei uma alteração (para efeito de teste) do parâmetro CURSOR_SHARING. Alterei ele do seu valor default "EXACT" para o valor "SIMILAR".
    Com a alteração, a taxa de hard parse diminuiu, e obtive um alto índice de reuso de query (ou scripts de modo geral).
    Os testes estavam indo bem, quando és que surge uma consulta semelhante a seguinte:
    select 'teste' as campo, 'Y' as tipo from dual
    union
    select 'teste1', 'N' from dual;
    Com o parâmetro alterado, essa consulta foi interpretada como:
    select '"SYS_B_0"' as campo, '"SYS_B_1"' as tipo from dual
    union
    select '"SYS_B_2"' as campo, '"SYS_B_3"' as tipo from dual;
    Até então, tudo ocorreu conforme esperado, porém na aplicação que faz uso dessa base existia um teste:
    <%
    'Código ASP
    if cstr(rs.fields("tipo")) = "Y" then
    << fazer algo >>
    else
    << fazer algo >>
    end if
    %>
    Mesmo quando o retorno da consulta era = "Y", nunca entre no if (e eu testei a consulta e ela realmente retornava Y).
    Quando fui verificar o retorno pela aplicação, o campo "tipo" retornava "Y ¢¥¥├ò", ou seja, com um lixo após o valor.
    Rodei a mesma consulta pelo sqlplus, e realmente o valor do retorno era apenas "Y".
    Tentei alterar o provider da string de conexão do banco para ver se era esse o problema, mas o mesmo persistiu. O Oracle Client no servidor da aplicação é o 10G.
    Não consegui entender o erro, e em todas as documentações e livros que pesquisei, os problemas oriundos da alteração desse parâmetro acarreta apenas em queda de performance (devido a por exemplo reutilizar um plano NÃO otimizado para uma consulta).
    Esse problema inviabilizou a alteração que se comportara muito bem em outros aspectos.
    Entendo que quando pensamos em reuso através de bind variables, associamos apenas à alterações dos parâmetros na seleção dos dados e não na projeção como é o caso citado.
    Alguém tem alguma ideia sobre o que pode ser e se tem alguma alteração que possa ser feita para conseguir o ganho da performance dos "soft parses"?
    Grato desde já.

    Hi,
    I'm a DBA for a company that uses Oracle 10G (release 10.2.0.3), and recently realized a change (for the purpose of testing) on parameter CURSOR_SHARING. I changed it to value "SIMILAR".
    With the change, the rate decreased hard parse, and got a high degree of reuse of query (and scripts in general).
    The tests were going well, when the query below arose:
    select 'test' as campo, 'Y' as tipo from dual
    union
    select 'test1', 'N' from dual;
    With the changed parameter, this query was interpreted as:
    select '"SYS_B_0"' as campo, '"SYS_B_1"' as tipo from dual
    union
    select '"SYS_B_2"', '"SYS_B_3"' from dual;
    Until then, everything went as expected, but the application that uses the database has a test:
    <%
    'ASP code
    if CStr (rs.Fields ("tipo")) = "Y" then
    << something >>
    else
    << something >>
    end if
    %>
    Even when the query was returning = "Y", never executed the if clause (and I tested the query and it really returned "Y").
    When I check the return by the application, the field "tipo" returned "Y ¢ ¥ ò ¥ ├", with a dirty code after.
    I execute the same query through sqlplus, and really the value of the return was only "Y".
    I tried changing the provider in the string connection of the database to see if that was the problem, but it persisted. The Oracle Client on the application server is 10G.
    I could not understand the error, and all documentations and books I researched, the problems arising from the change of this parameter causes only drop in performance (eg due to reuse a NOT optimized plan for a query).
    This problem prevented the change that had behaved very well in other respects.
    I understand that when we think of reuse through bind variables, only associate the changes of the parameters in the selection of the data and not in the projection as in the case cited.
    Anyone have any idea about what can be and if you have any changes that may be made to achieve the performance gain of the "soft parses"?
    Thankful now.
    <<< Sorry for my english >>>

  • CURSOR_SHARING fixed in Release 2?

    The IT team, here, had initially set CURSOR_SHARING to SIMILAR in 10g R1. They noticed that we were getting incorrect Data Dictionary values. So CURSOR_SHARING had to be set back to EXACT. It was a bug in 10g R1. Does anybody know if this issue was fixed in Release 2?

    I looked it up and it looks like it was addressed as a bug fix in Release 2 in the "10.2.0.3 Patch Set - List of Bug Fixes by Problem Type". Doc ID: Note:391116.1.
    I'm pasting the category of the bug fixs "Literal Replacement (CURSOR_SHARING)" along with the number and the text for the fix. This does seem to be related to DBMS_SQL:
    Literal Replacement (CURSOR_SHARING)
    4200541 -->Parse error when CURSOR_SHARING=FORCE|SIMILAR with user binds<--
    4254094      OERI[QERRMOBND1][932] possible for queries over DB links
    4607460      Dump [opipls] when CURSOR_SHARING = SIMILAR | FORCE
    4698156      ORA-12850 querying GV$ views when CURSOR_SHARING=FORCE
    5055175      Dump [kkslpkp] using literal replacement with timezone literals

  • How to increase dynamically open_cursors and session_cached_cursors

    how to increase dynamically open_cursors and session_cached_cursors
    for Ex. alter system open_cursors = 500

    instane level:
    alter system set session_cached_cursors=200 scope = spfile; or set init.ora file.
    alter system set open_cursors=400;
    More details about open_cursor and session_cached_cursor, refer the below link
    http://www.orafaq.com/node/758
    Regards
    RajaBaskar

  • Open_cursors and session_cached_cursors!!

    Hi, all.
    I have a 2 node RAC database (10.2.0.2.0) on windows2003 EE SP1.
    Recently, I am getting warnings related to "library cache lock" and "cursor: pin S wait on X" wait event.
    The recommendation from ADDM findigs is as follows.
    -- increase open_cursors
    -- increase session_cached_cursors
    The above parameters are dynamic ?? or do I need to restart the instances??
    Thanks and Regards.

    set linesize 121
    SELECT name, isses_modifiable, issys_modifiable
    FROM gv$parameter
    WHERE ....;

  • Changing value for open_cursors

    Dear All,
    I have changed the value for this parameter in a customized init.ora file which I give during the startup of the Database like this :
    startup open pfile=/software/initkbdev.ora
    I want to change the value for this permanently in the database.
    When I give the following command :
    startup open
    the value goes back to the previous one.
    How to make this change permanent ?
    How should I solve this ?
    Thanks in advance.
    Regds..Ramakrishnan

    Hi,
    If you startup your database with the right init.ora file, the open_cursor value in v$parameter can't "go back to his previous value".
    Check if you modify the right init.ora file.
    Fred

  • Cursor_sharing force partially parameter sql

    Hi ,
    We are running our application with weblogic ,jdbc thin client with Oracle 9.2.0.5 database.
    We have set cursor_sharing=FORCE in init.ora.
    Our problem.
    Java prepared statement with partial variable substitution is not sharing cursors, All other type of executions like update using sqlplus or without prepared statement they are sharing the cursors.
    For example.
    1)
    UPDATE t1 SET col1=? WHERE id = 123
    This gets translated into
    UPDATE t1 SET col1= :1 WHERE nid = 123
    where as
    2)
    UPDATE t1 SET col1=? WHERE id = ?
    It gets translated into
    UPDATE t1 SET col1= :1 WHERE nid = :2
    We haved 1000 of update statements run in our application as example 1)
    which is not sharing cursor.
    Is there any parameter we can set in database?
    This is happening in 9.2.0.6 also.

    <quote>Is there any parameter we can set in database?</quote>
    No.
    And the behavior you describe actually makes sense. If you used bind variables where you considered it to be appropriate [and conversely, didn’t use them where it wasn’t appropriate], why would Oracle come in and override your decision by blindingly replacing all remaining literals with binds?
    <quote>We haved 1000 of update statements run in our application as example 1) which is not sharing cursor.</quote>
    Then those statements have to be re-written. CURSOR_SHARING=FORCE at the instance level is supposed to be a temporary band-aid anyway … the fix is to address the underlying coding problem and revert to CURSOR_SHARING=EXACT. Maybe, just maybe … have CURSOR_SHARING other than EXACT at session level surrounding some particular piece of code deemed too risky to re-code (3rd party, undocumented, too obscure) … but some regular UPDATEs? … just fix.

  • How to inclease open_cursors in oracle?

    Hi, someone give me hands,please.
    I want to change oracle parameter "open_cursors" from default value of it.
    Where is init.ora file in oracle 10g database?
    Let me know.

    You can't have my hands, and it sounds like you should probably talk to the person who set the system up, if that is an option. This is probably one of the most basic of database administration tasks. If you don't know how to do this, you probaby shouldn't be working on a production system (assuming you are).
    Second, you probably want to make sure you really need to do this. The default value is 50 cursors per session. Not for the whole instance, that's for each session. Does your application really need to hold more than 50 cursors open in each database session? Or is it leaking cursors (as I suspect)?
    If you truly must change this value, try this while logged into SQL*Plus as SYSDBA:
    SQL> alter system set open_cursors=<new_value> scope=both;
    If that works, you are using SPFILE, which means that the initialization parameters are dynamically managed.
    If that returns "ORA-32001: write to SPFILE requested but no SPFILE specified at startup" then you are using init<sid>.ora files. You may have a file in $ORACLE_HOME/dbs (Linux/Unix) or in %ORACLE_HOME\database (Windows) called init<SID>.ora. If that is present, you can change the value for open_cursors by adding a line to that file or changing any existing setting to look like:
    open_cursors=<new_value>
    Regards,
    Jeremiah Wilton
    ORA-600 Consulting
    Recovery - Services - Seminars
    http://www.ora-600.net
    http://oradeblog.blogspot.com

  • Measuring the value of "session_cached_cursors"  and "open_cursor"

    Friends ,
    Recently In my Database production server Oracle10g (version : 10.2.0.1.0.), I got the "open_cursor" and "session_cached_cursors" related error where OEM asks to increase the value . I have increase the value but the problem still is not solved .
    Can anybody plz tell me , how can I measure the Standard value of "open_cursor" and also "session_cached_cursors" of my database server ?
    Another question ,
    SQL> show parameter open_
    NAME TYPE VALUE
    open_cursors integer 500
    In above output , what is the unit of 500 value . Is this value related with the SGA memory area ?

    shipon_97 wrote:
    Thanks all for reply ..
    I have another query ...
    How can I find the standarnd value of "open_cursor" as well as "session_cached_cursors" parameter value in the respect of my oracle database server . And what are the recommended value of these parameters . I am using oracle database 10g (v-10.2.0.1.0 ) .Shipon,
    You can see the values of the parameters in your db with the simple show parameter command,
    >
    show parameter open_cursors
    show parameter session_cached_cursors>
    About the settings of the parameters and their optimal value, I guess there wont' be any "concrete" answer to that. Session cached cursors is set to 50 default in Oracle which means 50 cursors can be marked as 'hot cursors' for the the system and will be avoided from the library cache lookup. This also has a condition that the cursor will be marked as hot only when its run for 3 times. So you need to check back with your system that how many queries are actually requiring this optimization. And more over, this is used or said to be used when you are seeing a Library Cache Latch contention. I don't think that just for the sake of change, you need to modify the parameter from default.
    The smae is true for the OPEN_CURSORS as well. The value is required to be changed if you are seeing an error about maximum opened cursor exceeding from the set value. Generally , a value of 2000 is enough for most of the systems but again, that may depend on site to site and surely enough , you need to check yours befoe playing around.
    HTH
    Aman....

  • What is the maximum size for open_cursors parameter in 11g database

    what is the maximum size we can set for open_cursors parameter in 11g database..

    Oracle® Database Reference
    11g Release 1 (11.1)
    Parameter type     Integer
    Default value     50
    Modifiable     ALTER SYSTEM
    Range of values     0 to 65535
    Basic     Yes
    For details, go to the following link:
    http://www.seasongreetings.org/documentation/oracle/database/11.1/server.111/b28320/initparams153.htm

  • How to choose  optimal value for  the OPEN_CURSOR parameter in init.ora?

    15:05:35 SQL> select count(*) from v$open_cursor;
    COUNT(*)
    5159
    15:06:28 SQL> select count(*) from v$open_cursor WHERE user_name='USER1';
    COUNT(*)
    2369
    15:06:48 SQL> select count(*) from v$open_cursor WHERE user_name='USER2';
    COUNT(*)
    686
    Currently, application using these number of open cursors?
    How to set the optimal value for this application?

    Hi,
    >>With the above setting I have yet to get any errors due to cursor limits. A good trade off memory v issues.
    To see if you have set OPEN_CURSORS high enough, monitor v$sesstat dynamic performance view using the SQL below for the maximum opened cursors. If your sessions are running close to the limit, maybe you should increase the value of OPEN_CURSORS.
    select max(a.value) as highest_open_cur, p.value as max_open_cur
    from v$sesstat a, v$statname b, v$parameter p
    where a.statistic# = b.statistic#
    and b.name = 'opened cursors current'
    and p.name= 'open_cursors'
    group by p.value;In addition, I advise you to take a look at your PL/SQL code in order to see if the explicit cursors have been close (if it was the case), or if your SQL code can be tuned ...
    Cheers
    Legatti

  • ORA 01745 (invalid host/bind variable name) and CURSOR_SHARING

    For the past couple of weeks, a user has had an issue with an application in the production environment only. I've had the vendor looking at it but they were limited since it could not be reproduced in our DEV environment. I finally had some time to look into it myself and I found the problem SQL statement. The issue boils down to this, "SELECT 'N' INDICATOR FROM DUAL;" returns an ORA-01745 error. If I rename "INDICATOR" to "INDICATO" or if I add an "AS" before the alias, the query works fine. However, it would require the vendor to change the code in the application which is not likely (not for free at least). However, I also found if I change the CURSOR_SHARING from SIMILAR to EXACT, then it works. This was the reason for the difference between DEV & PRD. PRD is set to SIMILAR while DEV is set to EXACT. The prospect of setting PRD to EXACT to appealing as I'm afraid it may affect performance in other areas. But, in the end, that may be the only solution. However, I was hoping there might be some other parameter that I am not aware of that may also fix this issue. I am running 10.2.0.4. Any help would be appreciated.

    I'm not sure.
    To what extent can you reproduce the problem? Can you isolate it to the db only via sql*plus? Or does this other software need to be involved?
    You may to do some end-to-end tracing including client/driver side.
    If you raise with Oracle Support, you may find out more.
    I take it that the software doesn't really issue this statement:
    SELECT 'N' INDICATOR FROM DUAL;" and it's part of a bigger statement?

  • ORA-00064 after changes processes, open_cursors in Oracle 10g Express

    Hi,
    I just run the following sql statements:
    alter system set processes=400 scope=spfile;
    alter system set open_cursors=5000 scope=spfile;
    After restart my computer, I can't connect to the oracle and in oradim.log i see the following error:
    ORA-00064: object is too large to allocate on this O/S (1,7999480)
    Any idea why and how can i solve it?
    Thanks a lot!

    Hi,
    Thanks for your help.
    I just open SQL and insert the following statement:
    create pfile from spfile;
    and i got the following error:
    SP2-0640: Not connected
    when i try to connect using conn user/pass@XE i got:
    ORA-12514: TNS:listener does not currently know of service requested in connect
    descriptor
    any idea?

  • What is table SYS.V_$OPEN_CURSOR for?

    I guess this table is used to record the info. of currently opened cursor, both explicit and implicit. But, somehow I found that the corresponding record in this table will not be deleted as soon as I close a explicit cursor using CLOSE command in a PL/SQL program block. Also, the record still remains after a function is executed if the cursor is declared in that function. Can any one tell me why?

    This is new optimitization of Oracle 8.1.6 database.
    Whit Oracle 8.1.5 when you close the cursor (JDBC or others) it automtically disappear from v$Open_cursors, but with 8.1.6 it still open in the database until the connection is closed.
    Best regards, Marcelo.
    null

Maybe you are looking for

  • Combining multiple rows into a single row

    Hi all, I have a tricky situation in a HR select. Imagine I have a dataset as below, simplified of course. Name Start Date End date Job Title Salary Tom 01/01/07 02/03/08 Gopher £500 Tom 03/03/08 jobsworth £600 Rick 04/05/09 Painter £500 Harry 02/06/

  • Problem with drill down

    Hello, Everybody. I am new to Application Express and I ask excuse for my English . I must construct an application that has this structure using the drill down: Initial report (the data is the result of a query) NOME1 NOME2 At the moment when clicki

  • External Sample Clock timeout

    Hi, I'm attempting to program up a Met One 010c cup anemometer which sends out 11V pulses whose frequency correlates to wind speed. I've written the following program Met One 010c-3b.vi which works when there's no sample clock and outputs data to the

  • Client Server mode for time ten connection

    Hi, I am new to Times Ten and got a question for running TimesTen in Client Server Mode. When it is running in Client/Server mode: Does the database just run like a regular remote database ? Is there security for the remote application, such as useri

  • Upgrade install died during upgrade - stuck

    Hi, last night I was upgrading my Ti-book to Leopard, when it finished and tried to install/reboot additional OS X packages over the internet, it died when updating the OS. Now when I try to reboot its just the white background and spinning wheel (fo