문제

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.

다른 팁

Im going to add this information here because i found it useful in solving my similar problem.

if you are getting a status of DISABLED or BYPASS remember

*The Result Cache memory area is located in the Shared Pool so, the value of result_cache_max_size is consumed from the Shared Pool size.*

so check the following parameters

show parameter shared_pool_size
show parameter result_cache_max_size
show parameter result_cache_mode

you can also try

BEGIN
    dbms_result_cache.ByPass(False);
END;
/
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top