1. SQL
SELECT
a.sql_text,b.name,
b.position,
b.datatype_string,
b.value_string
FROM
v$sql_bind_capture b,
v$sqlarea a
WHERE
b.sql_id = 'dpf3w96us2797'
AND
b.sql_id = a.sql_id;
2.
You can run a 10046 level 4 or 12 trace to debug code with bind variables and see the bind variable values as it steps through the code:
EXECUTE SYS.dbms_system.set_ev (42, 45529,10046,12,'');
然后在跟踪文件里可以看到绑定变量的值;
(1 = no binds,no waits, 4 = binds, no waits, 8 = no binds, waits, 12 = binds, waits)
3.注意事项
This view is populated only when you set STATISTICS_LEVEL parameter to ALL/TYPICAL . Bind capturing is disabled when the STATISTICS_LEVEL initialization parameter is set to BASIC.
本文介绍如何使用SQL查询捕获和绑定变量调试技术,包括SQL查询语法、执行过程中的绑定变量显示以及如何通过设置事件来查看绑定变量值。

被折叠的 条评论
为什么被折叠?



