Enabling result cache

Hi,
I am trying to enable result cache feature at Oracle 11g R2 server. I am following the below steps but everytime the cache status is coming DISABLED. Please help me to correct it
1. I am setting the RESULT_CACHE_MAX_SIZE and RESULT_CACHE_MODE as below. Memory_Target is 1232M, so I chose to allocate 200M for result cache.
ALTER SYSTEM SET RESULT_CACHE_MODE=FORCE
System altered.
ALTER SYSTEM SET RESULT_CACHE_MAX_SIZE=200M
System altered.2. I am restarting the database
SHUTDOWN IMMEDIATE
STARTUP
3. I am querying the result cache status
SELECT DBMS_RESULT_CACHE.STATUS FROM DUAL
STATUS
DISABLEDI have configured other database servers for cache and its working fine. But i am not able to sort out what is going wrong in above scripts. Please help me if i am missing out some step.
Thanks

select * from v$version;you need "Enterprise Edition" http://docs.oracle.com/cd/B28359_01/license.111/b28287/editions.htm
for EE check this:
http://psoug.org/reference/dbms_result_cache.html
http://www.oracle.com/technetwork/articles/datawarehouse/vallath-resultcache-rac-284280.html
http://www.oracle-developer.net/display.php?id=503

Similar Messages

  • How to Enable Result Cache in 11g XE ?

    Does anyone know how to enable the result cache in 11g XE?
    I've tired startup/shut down immediate with various ALTER SYSTEM commands (see below) but result_cache_max_size still defaults to zero when the database comes back up.
    ALTER SYSTEM SET result_cache_max_size = 2M SCOPE = SPFILE;
    ALTER SYSTEM SET result_cache_max_size = 2M SCOPE = BOTH;
    ALTER SYSTEM RESET result_cache_max_size SCOPE = SPFILE SID='*';
    Any advice would be helpful.
    Thanks

    In the [Licensing document|http://download.oracle.com/docs/cd/E11882_01/license.112/e10594/editions.htm#CJACGHEB] , in the 'performance' section of the table, the result cache is only available on Enterprise and not Standard, so I wouldn't expect it to work in Express Edition

  • PL/SQL Function Result Cache?

    Hi all,
    As we know, there's a new feature in 11g, called 'result cache', this 'result cache' can be shared throughout the whole instance, but if I got it right, only sql query result and function return value are cached, right? how about the store procedure, I mean, procedure also has its 'return value'--the output parameter, could it benefit from this new feature?
    Another question is, if my PL/SQL Function just retrieves the table and returns the result without any complicated calculation, is it necessary to enable the 'result cache' mechanism on this Function? because we already have 'db buffer cache' if the only thing we do is to query tables.
    Many thanks.

    Hi Morven,
    As of now, PL/SQL Result cache feature is only enabled for stored functions and not for procedures. This is due to the objectives they achieve. Functions are usually computative and procedures are for logic implementation.
    And for enabling result caching feature for a function, you are the better judge as u can test the performance in both the case. But, i would support enabling the cache because oracle 11g provides Cache as a different SGA component. db_buffer_cache will also be used for buffering other data blocks and not the result sets.
    Hope my explanation is fine.

  • Result Caching in OSB

    We are planning to implement OSB result caching feature in our project.We did the following to do a POC.
    1.Created a DBAdapter to select from a table and created a BS out of that.
    2.Enabled Result caching with TTL for 5 mins.
    3.Invoked the BS from a PS.
    4.Tested the PS by invoking from test cosnole.
    5.Response was received as expected.
    6.Changed the value in the table and tested again within 5 mins.
    7.New values were returned instead of the ones in the cache.
    What might be the problem?Should it not return the old value from table?

    Each cached result is uniquely identified by a cache key that is made up of the ServiceRef (the unique identifier for the service which is the fully qualified path name of the service), the operation being invoked, and a cache token String. The cache token helps to uniquely identify a single cache result among other cache results for one business service. You control the value of the cache token. You can set the cache token either by configuring the Cache Token expression in the Result Caching configuration for the business service or by using the cache-token metadata element in the $transportMetaData using the proxy service message flow. If there is no cache-token defined then caching may not work as expected.
    Please refer -
    35.7.5 Improving Performance by Caching Business Service Results at http://download.oracle.com/docs/cd/E17904_01/doc.1111/e15867/configuringandusingservices.htm#CHDDCGEE
    http://blogs.oracle.com/MarkSmith/2011/03/osb_and_coherence_integration_1.html
    Regards,
    Anuj

  • Result cache doubt

    what is the difference if i write relies_on clause or if i dont write it, technically please explain what exactly is the difference ??
    create or replace function tax (i in varchar2)
    return number
    result_cache
    is
    begin
    return i*0.08 ;
    end;
    create or replace function tax (i in varchar2)
    return number
    result_cache relies_on (emp)
    is
    begin
    return i*0.08 ;
    end;

    http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/function.htm#i34368
    RELIES_ON
    Specifies the data sources on which the results of a function depend. For more information, see Using the PL/SQL Function Result Cache. http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/subprograms.htm#BABFHACJ
    To enable result-caching for a function, use the RESULT_CACHE clause. When a result-cached function is invoked, the system checks the cache. If the cache contains the result from a previous call to the function with the same parameter values, the system returns the cached result to the invoker and does not reexecute the function body. If the cache does not contain the result, the system executes the function body and adds the result (for these parameter values) to the cache before returning control to the invoker.Not sure why are you talking about invalidated data, result_cache just invoked result from a previous call to the function if it exists, if not it executes the function body.
    The clause relies_on just specifies the data sources on which the results of a function depend.
    am i missing something??

  • Result cache refresh at business service (OSB) ?

    Hi,
    I have configured my business service at osb side to cache the result. My business service is pointing JCA- dbadapter which is calling a stored procedure.
    Is there any way to update/refresh the cache if there are any changes in the corresponding tables which the store procedure is using. I have googled a lot on this but have found nothing on it.
    Any help would be very much appreciated.

    Is there any way to update/refresh the cache if there are any changes in the corresponding tables which the store procedure is using. I have googled a lot on this but have found nothing onAFAIK, OSB does not provide any functionality to refresh the cache without hitting the backend sevice.
    The result caching in Oracle Service Bus is available for Business Services. When you enable result caching, the Business Service will not reach the backend service and the response will come from the cache entry. This entry can expire and if the entry is expired, the next service call will indeed reach the backend service and update the cache entry.
    Each cached result has its own TTL. When a TTL is reached, Oracle Coherence flushes that individual cached result.
    It would be better if you can raise a support ticket and ask for enhancement.
    Regards,
    Abhinav Gupta

  • Result Caching in Business Service

    Hi,
    We have a web service to the provider system and need to do the web service result in the Business service.
    We have enabled the caching and used the Cache token expression as given below.
    concat($body/sch:Request/sch:ID/text(),'-',$body/sch:Request/sch:FromDate/text(),'-',$body/sch:Request/sch:ToDate/text())
    But the expression seems to be not working. Please let me know if the expression syntax is correct and the ways to check if the result is returned from Cache (Apart from checking if the web services hitting Provider system).
    Any inputs on this will be very helpful
    Thanks,
    Arun M
    Edited by: 842347 on May 20, 2013 1:31 PM

    if your BS is based on a WSDL, this should take care of chaining the operation to the key to ensure uniqueness of the key in the cache.
    The official documentation (that I can't seem to find right now) explains how the Coherence key is formed:
    chaining the Service name, the operation and the eventual key you specify with an XPath.

  • SQL Result Cache  vs In-Memory Database Cache

    Hi,
    can anyone help me to understand the relations and differences between the 11 g new features of SQL Result Cache vs In-Memory Database Cache ?
    Thanks

    I highly recommend you read the 11g New Features Guide. Here is a sample from it:
    h4. 1.11.2.9 Query Result Cache
    A separate shared memory pool is now used for storing and retrieving
    cached results. Query retrieval from the query result cache is faster
    than rerunning the query. Frequently executed queries will see
    performance improvements when using the query result cache.
    The new query result cache enables explicit caching of results in
    database memory. Subsequent queries using the cached results will
    experience significant performance improvements.
    See Also:
    [Oracle Database Performance Tuning Guide|http://download.oracle.com/docs/cd/B28359_01/server.111/b28274/memory.htm#PFGRF10121] for details
    [Results Cache Concepts|http://download.oracle.com/docs/cd/B28359_01/server.111/b28274/memory.htm#PFGRF10121|Results Cache Concepts]
    HTH!

  • Does OCI client result cache and oracle UCP work together?

    I'm using Oracle 11.2.1.0. I've set up FCF and enabled OCI result cache on server side, so on client side, I'm using UCP for failover.
    this is my datasource configuration:
    <Resource name="jdbc/MyPool"
    auth="Container"
    factory="oracle.ucp.jdbc.PoolDataSourceImpl"
    type="oracle.ucp.jdbc.PoolDataSource"
    connectionFactoryClassName="oracle.jdbc.pool.OracleDataSource"
    url="jdbc:oracle:oci:@dbhost:1521/myDb"
    user="db_user"
    password="db_password"
    fastConnectionFailoverEnabled="true"
    onsConfiguration=""
    connectionPoolName="dbPool"
    initialPoolSize="5"
    minPoolSize="5"
    maxPoolSize="25"
    connectionWaitTimeout="10000"
    inactiveConnectionTimeout="120000"
    abandonConnectionTimeout="60"
    validateConnectionOnBorrow="true"
    sqlForValidateConnection="select user from dual"
    maxStatements="30"/>
    I've enabled OCI client result cache.
    I use /*+ result_cache */ in my query to take advantage of the result cache.
    so I execute the following scenario:
    i) select /*+ result_cache */ value from myTable where id=1; (this returns a result.)
    ii) update myTable to set a different value for id=1 record;
    iii) run select query again; (this should return a different result. oci result cache gets updated when table changes.)
    if I take out
    "sqlForValidateConnection" and/or "validateConnectionOnBorrow" (i.e. disable sql validation on borrow), the 2nd query after table update doesn't show the latest result. it's still showing the old query result.
    is this a bug? that UCP validation on borrow has an impact on OCI result cache function? this doesn't happen if using dbcp java connection pooling with OCI result cache.

    it turns out I ran the test against an oracle server that doesnt have FCF configured, nor ONS.
    once i switched to a correct oracle cluster, my test passed.

  • Difference Result Caching : OSB

    Hi
    In OSB, for a business service (based on a Java deployment on WebLogic server) I can see -
    Under Configuration Details - Message Handling Configuration-->Result Caching --> "Not Supported"
    Under Operational Settings - Result Caching-->Result Caching State--> This is enabled by default
    I have restarted server and executed a proxy flow. I think its still ON. I want it to be OFF.
    Can someone tell me if result caching should be ON or OFF in above scenario?
    -s-k

    what makes you think it's still on?
    the option in operation settings should be on if you're planning to use it on one of the other business services (it's the global enable setting)
    after that you can enable it per service with the settings in configuration details
    if you never want to use it it should be enough(i think) to disable it in the operation settings

  • OSB - Result Caching

    Hi,
    How do I confirm if the result caching is working? This is on the latest download available for OSB - 11.1.1.3.
    I tried to launch separate instances of caches, but could not confirm. Secondly, I also tried to enable caching support for a business service. I put in a hard coded expression in the cache token expression. I was not able to get that working.
    Any ideas?
    Regards,
    Anand.
    Edited by: user653362 on May 12, 2010 6:29 AM

    >
    How do I confirm if the result caching is working? This is on the latest download available for OSB - 11.1.1.3.
    >
    Perhaps the simplest way is to check access log on your backend (business service). Arrange a simple test that will lead to repeated callouts (with the same request data) to your business service. Than you should see only one (the first) request logged in your backend.
    The better way is to start another node of Coherence, connect to the OSB instance of Coherence and see what your cache looks like. Look at Coherence documentation for command line parameters:
    http://coherence.oracle.com/display/COH35UG/Command+Line+Setting+Override+Feature
    I was able to connect to the default OSB Coherence instance and list cached entries using this command:
    java -Dtangosol.coherence.cluster=OSB-cluster -Dtangosol.coherence.clusteraddress=228.8.8.8 -Dtangosol.coherence.clusterport=9888 -Dtangosol.coherence.distributed.localstorage=true -Dtangosol.coherence.override=/opt/Oracle11g/user_projects/domains/osb11_domain/config/osb/coherence/osb-coherence-override.xml -Dtangosol.coherence.cacheconfig=/opt/Oracle11g/user_projects/domains/osb11_domain/config/osb/coherence/osb-coherence-cache-config.xml com.tangosol.net.CacheFactory

  • Can't Enable write cache on disk with event ID 34

    One of our clients has a performance issue similar this one:
    Performance issue on TS as VM - Resolution with screenshots
    After monitoring it we found the problem is write cache. We improve the
    ... I
    checked all other VMs, the Enable advanced performance is unchecked. Do you
    ... A: To improve the performance for the disk, here are some proactively action
    plans:.
    www.chicagotech.net/remoteissues/tsperformance1.htm
    However, when we follow the resolution to Enable write cache, it doesn't take it with this event:
    Event Type: Warning
    Event Source: Disk
    Event Category: None
    Event ID: 34
    Description:
    The driver disabled the write cache on device \Device\Harddisk0\DR0.
    How to fix it?
    Bob Lin, MCSE &amp; CNE Networking, Internet, Routing, VPN Networking, Internet, Routing, VPN Troubleshooting on http://www.ChicagoTech.net How to Install and Configure Windows, VMware, Virtualization and Cisco on http://www.HowToNetworking.com

    Hi,
    By default, write caching is disabled on a disk that contains the Active Directory database (Ntds.dit). Also, write caching is disabled on a disk that contains the Active Directory log files. By doing this, you enhance the reliability of the Active
    Directory files.
    Thus if it is a DC, try to move the Active Directory database and the Active Directory log files off of a disk in which you need to enable write caching.
    If you have any feedback on our support, please send to [email protected]

  • Query result caching on oracle 9 and 10 vs indexing

    I am trying to improve performance on oracle 9i and 10g.
    We use some queries that take up to 30 minutes to execute.
    I heard that there are some products to cache query results.
    Would this have any advantage over using indexes or materialized views?
    Does anyone know any products that I can use to cache the results of this queries on disk?
    Personally I think that by using the query result caching I would reduce the cpu time needed to process the query.
    Is this true?

    Your message post pushes all the wrong buttons starting with the fact that 9i and 10g are marketing labels not version numbers.
    You don't tune queries by spending money and throwing resources at them. You tune them by identifying the problem queries, running explain plans, visualizing their output using DBMS_XPLAN, and addressing the root cause.
    If you want help post full version numbers, the SQL statements, and the DBMS_XPLAN outputs.

  • Oracle 11g result cache and TimesTen

    Oracle 11g has introduced the concept of result cache whereby the result set of frequently executed queries are stored in cache and used later when other users request the same query. This is different from caching the data blocks and exceuting the query over and over again.
    Tom Kyte calls this just-in-time materialized view whereby the results are dynamically evaluated without DBA intervention
    http://www.oracle.com/technology/oramag/oracle/07-sep/o57asktom.html
    My point is that in view of utilities like result_cache and possible use of Solid State Disks in Oracle to speed up physical I/O etc is there any need for a product like TimesTen? It sounds to me that it may just asdd another layer of complexity?

    Oracle result cache ia a useful tool but it is distinctly different from TimesTen. My understanding of Oracle's result cache is caching results set for seldom changing data like look up tables (currencies ID/code), reference data that does not change often (list of counter parties) etc. It would be pointless for caching result set where the underlying data changes frequently.
    There is also another argument for SQL result cache in that if you are hitting high on your use of CPUs and you have enough of memory then you can cache some of the results set thus saving on your CPU cycles.
    Considering the arguments about hard wired RDBMS and Solid State Disks (SSD), we can talk about it all day but having SSD does not eliminate the optimiser consideration for physical I/O. A table scan is a table scan whether data resides on SCSI or SSD disk. SSD will be faster but we are still performing physical IOs.
    With regard to TimesTen, the product positioning is different. TimesTen is closer to middletier than Oracle. It is designed to work closely to application layer whereas Oracle has much wider purpose. For real time response and moderate volumes there is no way one can substitue TimesTen with any hard wired RDBMS. The request for result cache has been around for sometime. In areas like program trading and market data where the underlying data changes rapidly, TimesTen will come very handy as the data is real time/transient and the calculations have to be done almost realtime, with least complications from the execution engine. I fail to see how one can deploy result cache in this scenario. Because of the underlying change of data, Oracle will be forced to calculate the queries almost everytime and the result cache will be just wasted.
    Hope this helps,
    Mich

  • Oracle 11g/R2 Query Result Cache - Incremental Update

    Hi,
    In Oracle 11g/R2, I created replica of HR.Employees table & executed the following statement (+Although using SUM() function is non-logical in this case, but just testifying the result+)
    STEP - 1
    SELECT      /+ RESULT_CACHE */ employee_id, first_name, last_name, SUM(salary)*
    FROM           HR.Employees_copy
    WHERE      department_id = 20
    GROUP BY      employee_id, first_name, last_name;
    EMPLOYEE_ID      FIRST_NAME LAST_NAME     SUM(SALARY)
    202           Pat           Fay          6000
    201           Michael           Hartstein     13000
    Elapsed: 00:00:00.01
    Execution Plan
    Plan hash value: 3837552314
    | Id | Operation           | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT      | | 2 | 130 | 4 (25)| 00:00:01 |
    | 1 | RESULT CACHE      | 3acbj133x8qkq8f8m7zm0br3mu | | | | |
    | 2 | HASH GROUP BY      | | 2 | 130 | 4 (25)| 00:00:01 |
    |* 3 | TABLE ACCESS FULL     | EMPLOYEES_COPY | 2 | 130 | 3 (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------------     Statistics
    0 recursive calls
    0 db block gets
    0 consistent gets
    0 physical reads
    0 redo size
    *690* bytes sent via SQL*Net to client
    416 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    2 rows processed
    STEP - 2
    INSERT INTO HR.employees_copy
    VALUES(200, 'Dummy', 'User','[email protected]',NULL, sysdate, 'MANAGER',5000, NULL,NULL,20);
    STEP - 3
    SELECT      /*+ RESULT_CACHE */ employee_id, first_name, last_name, SUM(salary)
    FROM           HR.Employees_copy
    WHERE      department_id = 20
    GROUP BY      employee_id, first_name, last_name;
    EMPLOYEE_ID      FIRST_NAME LAST_NAME SUM(SALARY)
    202      Pat      Fay      6000
    201      Michael      Hartstein      13000
    200      Dummy User      5000
    Elapsed: 00:00:00.03
    Execution Plan
    Plan hash value: 3837552314
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT |          | 3 | 195 | 4 (25)| 00:00:01 |
    | 1 | RESULT CACHE | 3acbj133x8qkq8f8m7zm0br3mu | | | | |
    | 2 | HASH GROUP BY | | 3 | 195 | 4 (25)| 00:00:01 |
    |* 3 | TABLE ACCESS FULL| EMPLOYEES_COPY | 3 | 195 | 3 (0)| 00:00:01 |
         Statistics
    0 recursive calls
    0 db block gets
    4 consistent gets
    0 physical reads
    0 redo size
    *714* bytes sent via SQL*Net to client
    416 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    3 rows processed
    In the execution plan of STEP-3, against ID-1 the operation RESULT CACHE is shown which shows the result has been retrieved directly from Result cache. Does this mean that Oracle Server has Incrementally Retrieved the resultset?
    Because, before the execution of STEP-2, the cache contained only 2 records. Then 1 record was inserted but after STEP-3, a total of 3 records was returned from cache. Does this mean that newly inserted row is retrieved from database and merged to the cached result of STEP-1?
    If Oracle server has incrementally retrieved and merged newly inserted record, what mechanism is being used by the Oracle to do so?
    Regards,
    Wasif
    Edited by: 965300 on Oct 15, 2012 12:25 AM

    965300 wrote:
    Hi,
    In Oracle 11g/R2, I created replica of HR.Employees table & executed the following statement (+Although using SUM() function is non-logical in this case, but just testifying the result+)
    STEP - 1
    SELECT      /+ RESULT_CACHE */ employee_id, first_name, last_name, SUM(salary)*
    FROM           HR.Employees_copy
    WHERE      department_id = 20
    GROUP BY      employee_id, first_name, last_name;
    EMPLOYEE_ID      FIRST_NAME LAST_NAME     SUM(SALARY)
    202           Pat           Fay          6000
    201           Michael           Hartstein     13000
    Elapsed: 00:00:00.01
    Execution Plan
    Plan hash value: 3837552314
    | Id | Operation           | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT      | | 2 | 130 | 4 (25)| 00:00:01 |
    | 1 | RESULT CACHE      | 3acbj133x8qkq8f8m7zm0br3mu | | | | |
    | 2 | HASH GROUP BY      | | 2 | 130 | 4 (25)| 00:00:01 |
    |* 3 | TABLE ACCESS FULL     | EMPLOYEES_COPY | 2 | 130 | 3 (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------------     Statistics
    0 recursive calls
    0 db block gets
    0 consistent gets
    0 physical reads
    0 redo size
    *690* bytes sent via SQL*Net to client
    416 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    2 rows processed
    STEP - 2
    INSERT INTO HR.employees_copy
    VALUES(200, 'Dummy', 'User','[email protected]',NULL, sysdate, 'MANAGER',5000, NULL,NULL,20);
    STEP - 3
    SELECT      /*+ RESULT_CACHE */ employee_id, first_name, last_name, SUM(salary)
    FROM           HR.Employees_copy
    WHERE      department_id = 20
    GROUP BY      employee_id, first_name, last_name;
    EMPLOYEE_ID      FIRST_NAME LAST_NAME SUM(SALARY)
    202      Pat      Fay      6000
    201      Michael      Hartstein      13000
    200      Dummy User      5000
    Elapsed: 00:00:00.03
    Execution Plan
    Plan hash value: 3837552314
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT |          | 3 | 195 | 4 (25)| 00:00:01 |
    | 1 | RESULT CACHE | 3acbj133x8qkq8f8m7zm0br3mu | | | | |
    | 2 | HASH GROUP BY | | 3 | 195 | 4 (25)| 00:00:01 |
    |* 3 | TABLE ACCESS FULL| EMPLOYEES_COPY | 3 | 195 | 3 (0)| 00:00:01 |
         Statistics
    0 recursive calls
    0 db block gets
    4 consistent gets
    0 physical reads
    0 redo size
    *714* bytes sent via SQL*Net to client
    416 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    3 rows processed
    In the execution plan of STEP-3, against ID-1 the operation RESULT CACHE is shown which shows the result has been retrieved directly from Result cache. Does this mean that Oracle Server has Incrementally Retrieved the resultset?
    Because, before the execution of STEP-2, the cache contained only 2 records. Then 1 record was inserted but after STEP-3, a total of 3 records was returned from cache. Does this mean that newly inserted row is retrieved from database and merged to the cached result of STEP-1?
    If Oracle server has incrementally retrieved and merged newly inserted record, what mechanism is being used by the Oracle to do so?
    Regards,
    Wasif
    Edited by: 965300 on Oct 15, 2012 12:25 AMNo, the RESULT CACHE operation doesn't necessarily mean that the results are retrieved from there. It could be being
    written to there.
    Look at the number of consistent gets: it's zero in the first step (I assume you had already run this query before) and I would
    conclude that the data is being read from the result cache.
    In the third step there are 4 consistent gets. I would conclude that the data is being written to the result cache, a fourth step repeating
    the SQL should show zero consistent gets and that would be the results being read.

Maybe you are looking for