获取SQL绑定变量的值

在AWR的TOP SQL中经常看到某些执行频繁的SQL都使用率绑定变量。

知道SQL_ID,能否找到绑定变量的值是多少呢?

 

   SQL> col bind_data for a20; SQL> select dbms_sqltune.extract_bind(w.bind_data, 1).value_string 2 ||'-'|| dbms_sqltune.extract_bind(w.bind_data, 2).value_string 3 ||'-'|| dbms_sqltune.extract_bind(w.bind_data, 3).value_string 4 ||'-'|| dbms_sqltune.extract_bind(w.bind_data, 4).value_string 5 ||'-'|| dbms_sqltune.extract_bind(w.bind_data, 5).value_string 6 ||'-'|| dbms_sqltune.extract_bind(w.bind_data, 6).value_string 7 bind_data ,q.SQL_TEXT 8 FROM sys.wrh$_sqlstat w,v$sql q 9 WHERE w.sql_id=q.SQL_ID 10 AND w.sql_id = 'g7x5p5cz25d3q'; BIND_DATA SQL_TEXT -------------------- --------------------------------------------------------- U32002000025----- UPDATE TEST SET VALIDSTATUS='1' WHERE AGENTCODE=:B1

 

 

 参考文档: http://www.eygle.com/archives/2010/11/dbms_sqltune_bindata.html

 

 

你可能感兴趣的:(sql,String,文档,2010)