I'm trying to use Oracle's Function Result Cache on 11.2.0, so I did the following test:
CREATE OR REPLACE FUNCTION get_test_value
  RETURN NUMBER
  RESULT_CACHE
AS
BEGIN
  dbms_output.put_line( 'Called' );
  RETURN 0;
END;
SELECT get_test_value FROM dual;
My example prints Called every time, though.
I also tried some other examples found online, but the cache is not used.
I tried ALTER SYSTEM SET result_cache_max_size = 10485760;
Still doesn't work.
I tried ALTER SESSION SET result_cache_mode=FORCE; (which should not be necessary) - didn't help.
SELECT dbms_result_cache.status FROM dual; always returns DISABLED.
What am I doing wrong?
Which edition are you using? The Cache functionality is only available in Enterprise Edition, so if you're trying this on a Standard Edition install it wouldn't work. It's in the Licensing Guide.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With