LOAD_PLANS_FROM_CURSOR_CACHE reads one or more SQL plans from the plan cache as a baseline plan.
Syntax
DBMS_SPM.LOAD_PLANS_FROM_CURSOR_CACHE (
sql_id IN VARCHAR,
plan_hash_value IN NUMBER := NULL,
fixed IN VARCHAR := 'NO',
enabled IN VARCHAR := 'YES'
)
RETURN PLS_INTEGER;
Parameters
| Parameter | Description |
|---|---|
| database_name | The name of the database. This parameter is required only in MySQL-compatible mode. |
| sql_id | The SQL_ID of the SQL statement to be loaded. |
| plan_hash_value | The Plan Hash Value of the plan to be loaded. If the value is NULL, all plans in the plan cache for the specified SQL statement are loaded as the baseline plan. |
| is_fixed | The is_fixed attribute of the loaded baseline plan. |
| enabled | The enabled attribute of the loaded baseline plan. |
Examples
DECLARE
v_load_plans number;
BEGIN
v_load_plans := DBMS_SPM.LOAD_PLANS_FROM_CURSOR_CACHE(
sql_id => '529F6E6454EF579C7CC265D1F6131D70',
plan_hash_value => 13388268709115914355);
END;
/