views:

199

answers:

1

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?

+4  A: 

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.

APC
Personal Edition may have it, but Personal Edition is Windows only and 11gR2 hasn't come out on windows yet
Gary
Ouch. Tried with Enterprise and it works like a charm :) Thanks a lot!
Peter Lang
@Peter Lang - Most of Oracle's sexy new features tend to be EE only (when they aren't chargeable extras) so the Licensing Guide is a vital read.
APC