1.查询"绑定变量分级"实验中,insert语句的传入值
由于子游标已经被ageout出sharedpool,所以这里使用dba_hist_sqlstat和
dbs_hist_sqlbind
①dba_hist_sqlstat
②dbs_hist_sqlbind
从上述查询结果可以看出,Oracle并不会捕获insert语句中values的具体传入值。
2.更改原SQL语句
原语句:insertintotvalues(:n,:v)
新语句:insertintotselect*fromtwheren=:nandv=:v;
selectsnap_id,dbms_sqltune.extract_bind(bind_data,1).value_stringbind1,
dbms_sqltune.extract_bind(bind_data,2).value_stringbind2
fromdba_hist_sqlstat
wheresql_id='21mycdpm39kzv'
orderbysnap_id;
selectsnap_id,name,position,value_string,last_captured,was_captured
fromdba_hist_sqlbind
wheresql_id='21mycdpm39kzv'
orderbysnap_id;
评论