对于Oracle10g之前的版本,使用绑定变量的缺点就是容易产出bind peeking,但出现这种情况时,最好把使用绑定变量的SQL语句修改为硬解析的方式。
对于问题系统的临时解决方案,参考老白的处理办法:
alter system flush shared_pool;
VAR st number;
exec :st := 1;//90%以上查询按此条件查询
select count(1) from t_employee e where st.status=:st;
VAR st number;
exec :st := 1;//90%以上查询按此条件查询
select count(1) from t_employee e where st.status=:st;
以上只是一个临时解决方案,数据库重启后就失效了,最好是从根本上解决该问题,修改查询SQL脚本。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9399028/viewspace-684120/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/9399028/viewspace-684120/