DML on any table or view used by the function. In a RAC envi‐ronment, each instance has its own result cache, which may differ in which items are cached, but common items in differ‐ent instances will never disagree with each other.
Whenever a result-cached function is called with new parame‐ters, both the parameters and the return value are saved in the cache. When the result-cached function is called with cached parameters, whether from your session or from a different one, the results are returned from the cache instead of being calcula‐ted anew. These cached entries can be monitored with the V$RESULT_CACHE% series of data dictionary views. Tune the size and usage of the result cache with the RESULT_CACHE_SIZE and RESULT_CACHE_MODE initial‐ization parameters and the DBMS_RESULT_CACHE built-in package.
• Defined with any OUT or IN OUT parameters
• Defined with any IN parameters of type BLOB, CLOB, NCLOB, REF CURSOR, object, or record
|Stored Procedures and Functions|||||117|
CREATE OR REPLACE FUNCTION factorial(n NUMBER) RETURN NUMBER RESULT_CACHE IS
IF n <= 1 THEN
For packaged functions, use the keyword RESULT_CACHE in both the package specification and the package body:
An Oracle user who creates a stored program will be able to execute that program unless nondefault privileges are in place. For other Oracle users to run the program, they would, at a minimum, need to be granted EXECUTE permission on it. This permission can be received via direct grant to the user, or via a grant to a database role that has been granted to the user.
When a user executes a stored procedure, Oracle has to evalu‐ate whether the user has permissions on the underlying objects