Oracle result Cache problem

Hello

In our database, we have the following settings for caching the result:

result_cache_max_result integer 5

result_cache_max_size great whole 256256 K

result_cache_mode chain MANUAL

result_cache_remote_expiration integer 0

But we use indicators no results hidden in questions, or tables that are enabled for result caching.

So from my understanding, caching the result should not happen.

But we met a performance problem, and when I checked the AWR report I found this:

latchfree.PNG

And also I found this activity latch:

rclatch.PNG

However, just set result_cache_max_size = 0 fixed to all our questions. Wait no more. Performance as expected.

But how is that possible? I thought with result_cache_mode = manual and not using indicators of result cache or table modes,.

There should be no result at all caching? Any max_size choose?

Can someone help me understand what is happening here?

Thank you and greet.

Daniel

tylerv wrote:

The original poster was not to the point and they actually understand the docs.

Sorry - I'm not okay. As I went to the docs are very EXPLICIT about how to disable the cache of result. If you turn it off, then it is enabled.

The fact that they have tried to do is that when result_cache_mode is set to the default value of the MANUAL, because they showed, it is, while according to the docs 12 c only the results of queries that use the RESULT_CACHE indicator must be stored in the cache of result

Maybe that's where you and OP have misunderstanding. on the RESULT_CACHE_MODE parameter and the parameter values. This seems to be a common misunderstanding.perhaps, because people are not read ALL the relevant articles of the RFSO and only looking at the section for this parameter.

There is NOTHING in the doc of 12 c for this parameter that shows ANY correlation to determine whether the cache is enabled or not.

Refer to the section "Setting the Mode of the result Cache"

https://docs.Oracle.com/database/121/TGDBA/tune_result_cache.htm#CDEJCGJD

As shown in table 15-3 there are ONLY two settings: MANUAL and FORCE. No adjustment said ANYTHING on toggle or if the cache is ENABLED or DISABLED.

... and they were not aware of all the queries that they had used this trick on.  When you're ready to values by default and don't use don't not result_cache indicator (as much), it's odd to find the cache of your result are so full.

OK - the USER does not use the indicator result-cache to cache the results of the queries USERS. But if the cache is enabled (size not equal to zero) that according to the quote from the doc above has NO effect on the use of Oracle to cache for queries or non-deterministic function calls.

I think a lot of people may be jumping on the server I mentioned first that article explicitly states that you must set the size to zero to disable hide and seek only to the section on setting the parameters.

And that the "setting mode" section is confusing as it includes a paragraph that uses the expression "If you choose to activate the result cache.

That subsection and the r-phrase likely cause people to think that the setting and the off/on State of the cache are one and the same.

When the result cache is enabled, the database also highlights cache queries that call non-deterministic functions of PL/SQL. When caching SELECT statements that call functions, result cache dependencies of data for PL/SQL functions and titles of database objects. However, if the function uses the data that are not followed (such as sequences, SYSDATE , SYS_CONTEXT and package variables), uses the cache of result on queries that call this function can produce stale results. In this regard, the behavior of the cache of result is identical to the caching of PL/SQL functions. So always consider the accuracy of the data, as well as performance, if you choose to activate the result cache.

But if all associated sections are interpreted in their context, it should clear up the misunderstanding.

If you have a support contract, you can submit a request to have the documentation changed to update mode setting (table 15-3) article to explicitly declare the parameter mode does NOT determine if the cache is enabled or not.

.

Tags: Database

Similar Questions

  • Back to search results Cache problem

    Hello

    A customer has just attracted my attention on a problem that seems to touch a lot of my and other sites of BC:

    JEALOUS. Contemporary Gallery, prints and Studio.

    http://wiredforwine.com/

    eCatalyst eCommerce website demo

    If you are looking for something (or product site search), click an item, and then use the back button of browser, you get the cache errors.

    What is happening at least in Chrome, Firefox and IE. I get these errors:

    [Chrome Mac]

    Confirm form submission

    ERR_CACHE_MISS

    Hide details

    This Web page requires data that you entered earlier in order to work correctly. You can send these data again, but in doing so, you will repeat any action this page made previously.

    Reload this Web page

    Press the button reload the data required to load the page again.

    [Firefox Mac]

    Document expired

    This document is no longer available.

    The requested document is not available in the cache of Firefox.

    Safety precaution, Firefox don't re-request not to automatically sensitive documents.

    Click try again to re - apply for the document from the website.

    [IE Windows]

    Page Web has expired

    The most likely cause:

    The local copy of this Web page is obsolete and the Web site requires that you download again.

    Something to try:

    Click the Refresh button in the toolbar to reload the page. After refreshing, you need to navigate to the Web page again, or re-enter information.

    The other encountered this problem? Is it because of how BC uses the browser's cache? is there a solution?

    Thank you

    Paul

    This is probably caused by the shoppingcartsummary module.

    Whenever you have it, this page will not be cached for obvious reasons, and working up the browser wants to redo the JOB and warns you

    Turn it off in the... search results page and use the liquid instead.

  • TimesTen and Oracle 11 g result cache

    Oracle 11g introduces the concept of cache the result whereby the result set of frequently executed queries are stored in the cache and used later when other users ask the same query. This is different from the caching of the data blocks and exceuting the query over and over again.

    Tom Kyte calls this materialized view just-in-time, in which case the results are dynamically evaluated without DBA intervention

    http://www.Oracle.com/technology/oramag/Oracle/07-Sep/o57asktom.html

    My point is that, given utilities like result_cache and possibility to use Solid State Disks in Oracle to accelerate physics I/O etc. is necessary for a product like TimesTen? It seems to me he could asdd just another layer of complexity?

    Oracle cache there result a useful tool, but it is significantly different from TimesTen. My understanding of the Oracle result cache is caching the results for rarely changing data such as search (currencies/identification code) tables, data reference that do not change often (list of counterparties) etc. It would be pointless to cache the result set when the data changes frequently.

    There is also another argument for the cache of SQL result that if you hit high on your CPU usage and that you have enough memory, then you can cache some defined thus results save on your cycles CPU.

    In view of the arguments on the wired RDBMS and drives (SSD), we can talk all day, but with SSDS does not eliminate the consideration for physical i/o optimizer. A table scan is a table scan if the data resides on disk SCSI or SSD. SSD will be faster, but we are still running physical IOs.

    What about TimesTen, the positioning of the product is different. TimesTen is closer to average than Oracle. It is designed to work closely at the application layer, while Oracle aims much more wide. There is no way one can replace TimesTen with any RDBMS wired for volumes of moderate and real-time response. Demand for the result cache has been around for a while. In areas like trading program and data on the market when the underlying data changes quickly, TimesTen will come handy, because time real/provisional data and calculations must be made almost in real time, with fewer complications of the execution engine. I don't see how we can deploy the result cache in this scenario. Due to underlying data change, Oracle is obliged to calculate queries almost everytime and the cache of result will be just wasted.

    Hope this helps,

    Mich

  • Result Cache in oracle 11g release 2.0.2.0

    All,

    A few months ago I tried function result Cache 11 g version 2.0.1.0. The oracle of time mentioned that they have 3 ways to use this feature by setting the parameter result_cache_mode AUTOMATIC, MANUAL or FORCE. With AUTO (result_cache_mode = AUTO) mode you can identify the queries that can benefit from the cache of the result. I would like to know what views or function I see where he captures this information.
    In 11.2.0.1.0 documentation he was making reference to certain points of view (totally forgot the names of views) and said: those that will be available in 11.2.0.2.0.

    Did anyone know about this?

    Thanks in advance.

    user2486753 wrote:
    Although doc oracle didn't tell on AUTO it is still accepts this value and caches the result of the SQL query if you add / * + cache result * / allusion to the SQL.
    I know that they mentioned in 112010 somewhere that will help users find what SQL is good candidates for caching by running the app for a while. I couldn't just fine there.

    If we add AUTO and always passing the tip, this is the same behavior as MANUAL. I'm not sure I've seen the value of anywhere and neither its there in the docs too.

    HTH
    Aman...

  • Caused by: java.lang.ClassNotFoundException: oracle.ias.cache.ObjectNotFoundException

    Hello

    I'm the EBS R12 incorporating OAM OID.

    Follow the below document mentioned,.

    Integration Oracle E-Business Suite Release 12 with Access Manager Oracle 11 GR 2 (11.1.2) using Oracle E-Business Suite AccessGate (Doc ID 1484024.1()

    get error in 5.2.4 check Oracle E-Business Suite AccessGate deployment

    http://ebstest.Oracle.com:7073/ebsauth_EBSTEST/ssologout_callback gives error like below


    java.lang.NoClassDefFoundError: oracle, ias, cache, ObjectNotFoundException

    to oracle.apps.fnd.ext.sso.AppsHttpServletRequestWrapper. (Unknown source)
    at oracle.apps.fnd.ext.sso.FndSsoLogout.doGet (unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.wrapRun (WebAppServletContext.java:3729)
    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3696)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    Caused by: java.lang.ClassNotFoundException: oracle.ias.cache.ObjectNotFoundException
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:64)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43)

    kindly help me to solve the problem above.

    Concerning

    Villi Kumar

    Hello

    We fixed the issue, now, we have access to the url.

    Solution:

    =======

    We have added the classpath to the setDomainEnv.sh script.

    From the setDomainEnv.sh file and started the server managed by script.

    It has worked well.

    Thanks for the suggestions.

    Concerning

    Kumar

  • Query result cache

    Today I test the query result cache, but the result is not as I expected. Please give a few advices.thank you in advance.

    SQL > create table (qrc_tab)

    Number 2);

    Table created.

    SQL > insert into qrc_tab values (1);

    1 line of creation.

    SQL > insert into qrc_tab values (2);

    1 line of creation.

    SQL > insert into qrc_tab values (3);

    1 line of creation.

    SQL > insert into qrc_tab 4;

    1 line of creation.

    SQL > insert into qrc_tab values (5);

    1 line of creation.

    SQL > create or replace function slow_function (p_id in qrc_tab.id%TYPE)

    2 back qrc_tab.id%TYPE DETERMINISTIC AS

    3 BEGIN

    4 DBMS_LOCK.sleep (1);

    5 return p_id;

    6 end;

    7.

    The function is created.

    SQL > set timing on

    SQL > select slow_function (id) in the qrc_tab;

    SLOW_FUNCTION (ID)

    -----------------

    1

    2

    3

    4

    5

    Elapsed time: 00:00:05.01

    SQL > select / * + result_cache * / slow_function (id) of qrc_tab;

    SLOW_FUNCTION (ID)

    -----------------

    1

    2

    3

    4

    5

    Elapsed time: 00:00:05.00

    SQL > select / * + result_cache * / slow_function (id) of qrc_tab;

    SLOW_FUNCTION (ID)

    -----------------

    1

    2

    3

    4

    5

    Elapsed time: 00:00:05.00

    SQL > select / * + result_cache * / slow_function (id) of qrc_tab;

    SLOW_FUNCTION (ID)

    -----------------

    1

    2

    3

    4

    5

    Elapsed time: 00:00:05.00

    I wonder why time is not fast? Help, please

    create or replace function slow_function (p_id in qrc_tab.id%TYPE)

    return qrc_tab.id%TYPE result_cache DETERMINISTIC AS

    Start

    DBMS_LOCK. Sleep (1);

    return p_id;

    end;

    /

    --

    John Watson

    Oracle Certified Master s/n

  • Using the ODP client result cache still shows it as running on AWR, is the work of cache?

    Hello

    I use the Oracle 12 manged customer ODP.net connected to a database of GR 11, 2. I recently went on the cache of results with great effectiveness.

    So, I thought I would try the result to the client cache. I have the setting turned on and restarted my db, but my questions always appear in the graphs of Enterprise manager and the AWR report. I would have thought if the query has been cached on the client, that it does not show.

    How will I know if it works or not?

    Thanks in advance.

    Adrian.

    Re-reading the original question, I missed the fact that you use managed ODP.NET. The client result cache does not support managed ODP.NET. Only unmanaged ODP.NET is because it uses the capacity, within the OIC, that uses the unmanaged code.

    I apologize for the misunderstanding.

  • Update statement can be used depending on the result cache?

    Hi all

    I stumbled on an interesting question. UPDATE statement is used in the following function, even if the feature is created RESULT_CACHE. It seems illogical. I was wondering, is it possible?

    If so, why RESULT_CACHE is used?  Because it means "do not execute the function, look for the result of the hash table and return the results to the user ' if the UPDATE statement, so doesn't mean it should run for each call and use with RESULT_CACHE and UPDATE/DELETE/MERGE is illogical or wrong?

    Thanks for your help.

    FUNCTION to CREATE or REPLACE plch_get_data (FULL id_in)

    RETURN VARCHAR2

    RESULT_CACHE

    IS

    BEGIN

    Dbms_output.put_line ('run');

    UPDATE plch_data

    SET nm = UPPER (nm)

    WHERE id = id_in;

    COMMIT;

    RETURN "SUPERIOR."

    END;

    /

    Yes, it's the challenge of PL/SQL quiz - and the point of the quiz is only automatic relies on parsing by Oracle only supports arrays of account that is QUESTIONED.

    The tables that are affected by DML not a query as an update do not figure in automatic invalidation of a cache.

    I was hoping that the explanations given in the questionnaire itself would not lead to a thread - rather it would provide a pleasant and clear answer. So feel free to let me know if you think otherwise.

    As to why Oracle would let you include DML not a query inside a function of caching of result, well... I can easily accept that you shouldn't do this - in general. But I don't see that we should make it impossible. It would probably be a good candidate for an another PLW (PL/SQL warning), as in:

    "Non-requetes DML in a result caching function will not affect caching and can result in unexpected results."

  • Result Cache not used

    Hello

    I'm on Oracle Database 11 g Release 11.2.0.3.0 and Application Express 4.2.2.00.11

    How to use trick cache result?

    How do you get the same result shown in Figuree 3 (apex.oracle.com Application Express 4.2.6.00.03) ?

    I try to use the result cache but explain plan does not appear to be used (Figure 1)

    Then I tried ' alter table STUDENT result_cache (FORCE mode);  In figure 2, you could see that column in the table of students result_cache was changed to 'force' but explain the plan shows yet cache result being used.

    Figure 1
    result_cache1.jpg

    Figure 2

    result_cache2.jpg

    Figure 3 (from apex.oracle.com workspace)

    result_cache_correct.jpg

    Hello

    Thank you all for your answers.

    According to Oracle Help Center (11 g release 2) this is a feature reserved for Enterprise Edition. And Apex.oracle.com from today using Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production.

    While I'm using Oracle Database 11 g Release 11.2.0.3.0 - 64 bit Production it is why in the screenshots above I could not duplicate the result in apex.oracle.com

    https://docs.Oracle.com/CD/E11882_01/license.112/e47877/editions.htm#DBLIC116

  • Consider the function result Cache

    Hello

    Have a question about the function result to cache.

    Follow this link: http://www.oracle.com/technetwork/articles/sql/11g-caching-pooling-088320.html

    I use the following version of oracle: Oracle Database 11g Express Edition Release 11.2.0.2.0

    I'm doing using the feature of function result cache.

    Please find the source code used, below:

    create or replace function fnresultcahceg (empid employees.employee_id%type)

    employees.salary%type result_cache relies_on (employees) is back

    l_salary employees.salary%type;

    Start

    Select the wage in l_salary of employees where employee_id = empid;

    DBMS_LOCK. Sleep (1);

    Return l_salary;

    end fnresultcahceg;

    Try to run the function created above with the following:

    SQL > select fnresultcahceg (200) double;

    FNRESULTCAHCEG (200)

    -------------------

    4400

    Elapsed time: 00:00:01.15

    SQL > select fnresultcahceg (201) twice;

    FNRESULTCAHCEG (201)

    -------------------

    13000

    Elapsed time: 00:00:01.01

    SQL > select fnresultcahceg (200) double;

    FNRESULTCAHCEG (200)

    -------------------

    4400

    Elapsed time: 00:00:01.00

    SQL > select fnresultcahceg (201) twice;

    FNRESULTCAHCEG (201)

    -------------------

    13000

    Elapsed time: 00:00:01.01

    SQL > select fnresultcahceg (201) twice;

    FNRESULTCAHCEG (201)

    -------------------

    13000

    Elapsed time: 00:00:01.00

    SQL > exec dbms_output.put_line (fnresultcahceg (200));

    4400

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:01.04

    SQL > exec dbms_output.put_line (fnresultcahceg (201)).

    13000

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:01.03

    SQL > exec dbms_output.put_line (fnresultcahceg (201)).

    13000

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:01.01

    SQL > exec dbms_output.put_line (fnresultcahceg (201)).

    13000

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:01.00

    SQL > exec dbms_output.put_line (fnresultcahceg (201)).

    13000

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:01.00

    SQL > exec dbms_output.put_line (fnresultcahceg (201)).

    13000

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:01.01

    SQL > spool off;

    We could see no improvement in time elapsed execution.

    Have a doubt on the am I missed something / do wrong to the result of the setting of the cache settings.

    Have you tried with the following result cache settings

    ALTER SYSTEM SET result_cache_max_size = 2M RANGE = MΘMOIRE

    ALTER SYSTEM SET result_cache_remote_expiration = 2;

    ALTER SYSTEM SET result_cache_mode = {MANUAL |} STRENGTH} - two similar agronomic results

    The wait was to reduce the execution time after its first execution if the data remains the same.

    Please guide me in this regard.

    Thanks in advance,

    Sandeep.S

    > I use the next version of oracle: Oracle Database 11g Express Edition Release 11.2.0.2.0.

    PL/SQL function result Cache is only available in Oracle Database Enterprise Edition (EE).

    Concerning

  • Oracle XE text problem

    I have a XE Database 11.2 under Windows, with Oracle 11.2.0.2.0 text, all verified object, which has an import Application Apex that was exported form Oracle 10 without problem.

    I used the data pump to fill the underlying tables of the demand, which was also successful, but need to re-create full-text indexes in the instance target of 11.2.

    I used ctx_report.create_index_script to create the 4 that I needed, without issue.

    When the first script on the instance running target while running OK except for the section "create index", and I can't seem to work around the problem.

    The part of the script that fails is

    creating index 'SCHEMA_OWNER '. "" A_INDEX1 ".

    on "SCHEMA_OWNER". » A »

    ('A1')

    indexType is ctxsys.context

    parameters (')

    data store "A_INDEX1_DST".

    filter "A_INDEX1_FIL".

    Group of the section "A_INDEX1_SGP".

    lexer "A_INDEX1_LEX."

    list of words "A_INDEX1_WDL".

    stoplist 'A_INDEX1_SPL '.

    storage "A_INDEX1_STO."

    ')

    /

    Which returns the following errors

    ERROR on line 1:

    ORA-29855: an error has occurred in the execution of routine ODCIINDEXCREATE

    ORA-20000: Oracle text error:

    DRG-50857: error oracle in drvxtab.create_index_tables

    ORA-00905: lack of keyword

    ORA-06512: at "CTXSYS. DRUE", line 160

    ORA-06512: at "CTXSYS. TEXTINDEXMETHODS', line 366

    Can anyone help point me in the right direction, a little crazy.

    I have now managed to solve this problem, and kevinUBC is right, the error was in the storage clause.  The problem was caused by the rupture in 3rd line of the storage clause to the semi colon ^^.

    Start
    ctx_ddl.create_preference ('"A_INDEX1_STO" ', 'BASIC_STORAGE');
    ctx_ddl.set_attribute (' 'A_INDEX1_STO"', 'R_TABLE_CLAUSE',' lob (data) store (cache) ');

    ctx_ddl.set_attribute ('"A_INDEX1_STO" ', 'I_INDEX_CLAUSE', 'compress 2')

    ;

    end;

    I dropped the clause storage with ctx_ddl.drop_preference and recreated with the semi colon at the right place, the index created then no problem

    Thank you all

  • Using the Client result Cache

    Hi all

    I have a question about the use of the result of the client cache but first of all, here is the information on my database:

    SQL> SELECT * FROM v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0    Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    
    

    I installed the Oracle Client Tools on my clientmachine. There a tnsnames.ora like this:

    ORCL =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = FEA11-119SRV)(PORT = 1521))
        )
        (CONNECT_DATA =
          (SERVICE_NAME = orcl.local)
        )
      )
    
    

    The result of the Client Cache is configured in the sqlnet.ora.

    ADR_BASE = /u01/app/oracle
    OCI_RESULT_CACHE_MAX_SIZE= 2048000
    OCI_RESULT_CACHE_MAX_RSET_SIZE = 1024000
    NAMES.DIRECTORY_PATH = (EZCONNECT, TNSNAMES, HOSTNAME)
    
    

    The Databaseserver is configured like this:

    
    SQL> col name format a30
    SQL> col value format a30
    SQL> SELECT name, value
      2  FROM   v$system_parameter
      3  WHERE  name LIKE '%result_cache%';
    
    NAME                   VALUE
    ------------------------------ ------------------------------
    result_cache_mode           MANUAL
    result_cache_max_size           0
    result_cache_max_result        5
    result_cache_remote_expiration 0
    client_result_cache_size       1073741824
    client_result_cache_lag        3000
    
    

    After you set up a client's server, I try the SQL query on the clientmachine followign:

    sqlplus oracle/password@orcl
    
    set autotrace traceonly explain
    
    SELECT /*+ result_cache */ *
    FROM testtable;
    

    You cannot enable the customer with SQL result cache * more, no matter what you do with parameters. If you install the CD examples, you will find examples of code in cdemoqc.c and cdemoqc2.c that shows how with the OCI calls.

    You probably want to use the result of the server cache, there is a full demo of this here,

    Using the SQL Oracle 11g result Cache

    --

    John Watson

    Oracle Certified Master s/n

  • Issue of result cache

    I create and populate the following table in my schema:
     create table plch_table (id number, time_sleep number);
    
    begin
      insert into plch_table values (1, 20);
      commit;
    end;
    / 
    Then I create this function (it compiles successfully, since my schema has EXECUTE authority on DBMS_LOCK):
     create or replace function plch_func
      return number
      result_cache
    is
      l_time_sleep number;
    begin
      select time_sleep
        into l_time_sleep
        from plch_table
       where id = 1;
       
      dbms_lock.sleep(l_time_sleep);
     
      return l_time_sleep;
    end;
    / 
    I then start up a second session, connected to the same schema, and execute this block:
     declare
      res number := plch_func;
    begin
      null;
    end;
    / 
    Within five seconds of executing the above block, I go back to the first session and I run this block:
     declare
      t1 number;
      t2 number;
    begin
      t1 := dbms_utility.get_time;
      dbms_output.put_line(plch_func);
      t2 := dbms_utility.get_time;
    
      dbms_output.put_line('Execute in '||round((t2-t1)/100)||' seconds');
    end;
    / 
    
    what will be displayed after this block executes?
    
    And the result is:
    
    20
    Execute in 30 seconds
    However, I do not understand why? I mean what happens behind all this? Why the 30 result? Could someone tell me why?

    Honestly, before the issue of PL/SQL challenge of yesterday, I had no idea how it worked either. It is much a deep internals question - you would probably pick up a post from presentation or very specialized blog get more details (or that you would have to do the research yourself). And even then, it is relatively unlikely that they would go in a lot more detail than the PL/SQL Challenge response has been. Julain Dyke result Cache Internals (PPT) is probably one of the more detailed presentations on the internals of the result cache.

    All of the valid statuses for a result cache object are documented in the entry reference of Oracle database to the view v$ result_cache_objects. Delays second two 10 are controlled by the session level settings and database of the resultcache_timeout undocumented parameter (which, based on this blog by Vladimir Begun has been fixed at 60 seconds in 11.1.0.6 and changed to 11.1.0.7 to 10 seconds.)

    Justin

  • Result Cache indicator

    Hi all
    What are the restrictions of use result indicator cache on queries? How to use Union or join or subqueries? What doc should I read about it?

    Also, I run the following queries on the HR diagram example:
    select first_name,(select /*+ RESULT_CACHE */ last_name from employees where employee_id=100) from employees;
    select first_name from (select /*+ RESULT_CACHE */ first_name from employees);
    Using
    select name, value from v$result_cache_statistics where id=7;
    I can check if the first subquery, where it is evaluated in each row, using no indicator result hides while the second use on. How do I?

    Best regards
    Val

    Select first_name, (select / * + RESULT_CACHE * / last_name of employees where employee_id = 100) of employees;

    (Of course, this is an artificial example, but one) result_cache indicator does not work in a scalar subquery, unless you move out in a CTE first (WITH clause) and b) without result caching, you will benefit from [url http://www.oratechinfo.co.uk/scalar_subqueries.html] scalar subquery caching anyway.

    You might also be interested in some of the debates on this topic:
    Problem with caching the result

  • Create a group of cache problem

    Hello

    I have three tables T1, T2 and T3 in Oracle. The T3 table has two foreign keys F1 and F2 which refers to tables T1 and T2, respectively. When I try to create the cache group in TimesTen for table T3, I get the following error:

    «8211: user table.» T1 is not a member of the Group of cache.

    Here's the script for Oracle and TimesTen

    Oracle
    ======


    CREATE TABLE T1
    (ID1 integer PRIMARY KEY,
    A varchar (30));

    CREATE TABLE T2
    (ID2 integer PRIMARY KEY,
    A varchar (30));

    CREATE TABLE T3
    (ID3 integer PRIMARY KEY,
    OF THE varchar (30),
    Whole F1 references T1 (ID1),
    Entire F2 references T2 (ID2)
    );


    TimesTen
    ========


    CREATE GROUP OF READONLY C_T1 CACHE
    AUTOREFRESH INTERVAL 5 SECONDS
    FROM T1
    (ID1 NUMBER (38) NOT NULL PRIMARY KEY,)
    THE VARCHAR2 (30));

    CREATE GROUP OF READONLY C_T2 CACHE
    AUTOREFRESH INTERVAL 5 SECONDS
    THE T2
    (ID2 NUMBER (38) NOT NULL PRIMARY KEY,)
    THE VARCHAR2 (30));

    CREATE GROUP OF READONLY C_T3 CACHE
    AUTOREFRESH INTERVAL 5 SECONDS
    T3)
    ID3 NUMBER (38) NOT NULL PRIMARY KEY,
    F1 NUMBER (38) NOT NULL,
    F2 NUMBER NOT NULL, (38)
    FOREIGN KEY (F1) REFERENCES (ID1) T1,
    FOREIGN KEY (F2) REFERENCES T2 (ID2),
    THE VARCHAR2 (30));


    How can I create groups of cache of these paintings? Please notify
    Thank you

    Vishin Das

    There are two problems here:

    1. If you want to set a FK between tables cached in TimesTen then all tables must be part of the same group of cache.

    2. part of a group of cache, that you must have a single table at a higher level and all the other tables should be child tables of this table or one of its children. Which tables should be linked hierarchically.

    So at first glance you may not be cached in this series of paintings in TimesTen, but actually you can because...

    1. you do not have to set all the present FKs in oracle in cache TT groups. for groups of READONLY cache isn't generally a problem because FK execution happens in Oracle. Sometimes, it is not a problem for WAT cache groups either, but you know how the application handles data to be sure about this.

    2. all READONLY cache with the same AUTOREFRESH interval groups are updated in the same transaction; You can avoid transactional inconsistencies in the data in the cache.

    So the best solution here is probably:

    CREATE GROUP OF READONLY C_T1 CACHE
    AUTOREFRESH INTERVAL 5 SECONDS
    FROM T1
    (ID1 NUMBER (38) NOT NULL PRIMARY KEY,)
    THE VARCHAR2 (30));

    CREATE GROUP OF READONLY C_T2 CACHE
    AUTOREFRESH INTERVAL 5 SECONDS
    THE T2
    (ID2 NUMBER (38) NOT NULL PRIMARY KEY,)
    THE VARCHAR2 (30));

    CREATE GROUP OF READONLY C_T3 CACHE
    AUTOREFRESH INTERVAL 5 SECONDS
    T3)
    ID3 NUMBER (38) NOT NULL PRIMARY KEY,
    F1 NUMBER (38) NOT NULL,
    F2 NUMBER NOT NULL, (38)
    THE VARCHAR2 (30));

    CREATE INDEX T3_IX1 ON T3 (F1);
    CREATE INDEX T3_IX2 ON T3 (F2);

    Indexes are created based on the assumption that, when the application queries these tables cached, it is likely to join based on the PK/FK relationship. The presence of the indices will speed up joins immensely.

    Chris

Maybe you are looking for

  • after upgrade to 29.0 customizations go back to the previous positions.

    My problem is quite simple (if not boring), I have a problem with my browser customization. my original question was the theme linked however this was rectified with the Restorer 'classic theme... now, everything's fine, l sorted all the customizatio

  • want to 700: DRIVER_IRQL_NOT LESS or EQUAL (kbdclass.sys)

    After (I think) an update of Microsoft, I get the BSOD with the above error, (LESS or EQUAL (kbdclass.sys)) of DRIVER_IRQL_NOT I restarted several times and cannot connect directly to the machine, however, I CAN connect to remote and rune it this way

  • Updated 10.11.3 don't process not

    The update to 10.11.2 10.11.3 do not operate briefly after a few first bytes (about 64 MB) downloaded and freezes then after this point. The messages in the system control, I get are (the same after testing repeated): App Store [417]: Class unknown F

  • U410: Cannot access BIOS

    Hello I run into a problem with the Bios. A few days ago, I changed some settings in the Bios and now I can't access it. There is no support on don't enter to interrupt the boot, F1, or other buttons do not have Bios at startup. What can I do to ente

  • Vista - Error code: 80070490 & 80240016 (cannot install updates)

    Windows Update error Code: 80070490,80240016 OS: WIndows Vista Ultimate SP2 I had this error on update during the installation of 4 important updates. KB967723, KB970430, KB2158563 KB972145. 1 leva code error It was suggested to repair windows. It di