如果我在下面的图1中运行SQL,它可能会返回如下内容:
Select fname, lname from name_tbl where nam_key = :key
如果不使用某些花哨的DBA跟踪实用程序,如何查询Oracle系统表以查找绑定变量“:key”的值?
图1. - 列出当前正在运行的sql语句。
select sid, username, sql_text
from v$session,
v$sqltext
where sql_address = address
and sql_hash_value = hash_value
order by sid, piece;
答案 0 :(得分:6)
select name, value_string
from v$sql_bind_capture
where sql_id = your_query_id
UPD。或者,当然:
select sql_id, value_string
from v$sql_bind_capture
where name = ':key'