oracle - How to keep cursors in v$sql_plan alive longer -
i'm trying analyse query execution plan in oracle database. have set
alter system set statistics_level = all; such can compare estimated cardinalities , times actual cardinalities , times. now, i'm running statement in order display information.
select * table(dbms_xplan.display_cursor( sql_id => '6dt9vvx9gmd1x', cursor_child_no => 2, format => 'allstats last')); but keep getting message
note: cannot fetch plan sql_id: 6dt9vvx9gmd1x, child_number: 2 please verify value of sql_id , child_number; plan no longer in cursor cache (check v$sql_plan) the child_number correct when query being executed. also, when run dbms_xplan.display_cursor @ same time query, actual plan. jdbc connection closes preparedstatement after execution, maybe that's why execution plan disappears v$sql_plan.
am getting wrong, or how can analyse estimated/actual values after execution?
increase shared_pool create more caching space cursors. if in 11g, capture sql plan in baselines using optimizer_capture_sql_plan_baselines. stores plans in dba_sql_plan_baselines.
Comments
Post a Comment