SPM_AWR
emcs
32次下载
479次浏览
2019-07-24
4.5

脚本内容

-- 给特定SQL绑上AWR中已有的特定执行计划,需要事先查询得到对应的SNAP_ID,sql_id 和 plan_hash_value, COE_profile.sql 的SPM版 declare v_cur dbms_sqltune.sqlset_cursor; p_filer varchar2(1000); v_sqlsetname varchar2(100) default 'ENMO Tuning'; v_sqlsetowner varchar2(100) default 'APPS'; v_cnt number; begin p_filer:='sql_id=''&sqlid'' and plan_hash_value=&good_Plan_hash'; open v_cur for 'select value(p) from table(dbms_sqltune.select_workload_REPOSITORY(&bid,&eid,:filer))p' using p_filer; dbms_sqltune.load_sqlset(v_sqlsetname,v_cur); close v_cur; v_cnt:=dbms_spm.load_plans_from_sqlset(v_sqlsetname,v_sqlsetowner,p_filer); commit; end; /

评论

贡献排行榜