1

我知道我可以SELECT sql_text FROM v$sql获取查询,但这不是正在运行的实际查询,因为它仍然包含变量。

例如它返回

SELECT H.TYPE, H.STATUS, L.FLAG_2, L.QTY_ORDERED
FROM ODH H, ODL L
WHERE H.ORDER_NUMBER = L.ORDER_NUMBER
AND L.ORDER_NUMBER = :B2
AND L.ORDER_LINE = :B1
AND ROWNUM = 1

有没有办法查看正在运行的实际查询,以便我可以确定传递给查询的值?

4

1 回答 1

1
SELECT sql_id, value_string
FROM v$sql_bind_capture
WHERE name = ':B2'
OR name = ':B1'

或者

SELECT name, value_string
FROM v$sql_bind_capture
WHERE sql_id = your_query_id
于 2015-03-03T00:27:14.227 回答