ITPub博客

SPM

原创 Oracle 作者:oracle单细胞 时间:2018-08-11 11:37:46 0 删除 编辑

alter session set optimizer_use_sql_plan_baselines=false;

alter session set cursor_sharing = force;

alter session set optimizer_capture_sql_plan_baselines=true;

alter system flush shared_pool;

select object_id,object_name, object_type  from t1 where object_id between 103 and 108;

select * from table(dbms_xplan.display_cursor(null,null,'advanced'));

select sql_handle,plan_name,origin,enabled,accepted,sql_text from dba_sql_plan_baselines where sql_text like 'select object_id,object_name, object_type  from t1%';

exec dbms_stats.set_index_stats(ownname=>'SDE',indname=>'IDX_T1',clstfct=>2400000000000000,no_invalidate=>false);

select index_name,clustering_factor from  dba_indexes where index_name='IDX_T1';

select object_id,object_name, object_type  from t1 where object_id between 103 and 108;

select * from table(dbms_xplan.display_cursor(null,null,'advanced'));

exec dbms_stats.gather_table_stats(ownname=>'SDE',tabname=>'T1',estimate_percent=>100,cascade=>true,no_invalidate=>true);

SQL_PLAN_8a1fntd5dbh5w844cb98a

alter session set optimizer_use_sql_plan_baselines=true;

alter session set optimizer_capture_sql_plan_baselines=false;


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29741328/viewspace-2199856/,如需转载,请注明出处,否则将追究法律责任。

下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2014-07-07

  • 博文量
    16
  • 访问量
    10550