本文介绍了如何在从 v$sql 收到的 Oracle 查询中查找参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用查询:

 select LAST_LOAD_TIME, ELAPSED_TIME, MODULE, SQL_TEXT elasped from v$sql
 WHERE MODULE='JDBC Thin Client'
 ORDER BY LAST_LOAD_TIME DESC

消失了:

 delete from tableA where fk in (select pk from tableB where tableB.fk=:1
 and tableB.date between :2 and :3)

是否可以找到这些参数 1、2 和 3?

Is it possible find these parameters 1, 2 and 3?

推荐答案

是这样的:

select s.sql_id, 
       bc.position, 
       bc.value_string, 
       s.last_load_time, 
       bc.last_captured
from v$sql s
  left join v$sql_bind_capture bc 
         on bc.sql_id = s.sql_id 
        and bc.child_number = s.child_number
where s.sql_text like 'delete from tableA where fk%' -- or any other method to identify the SQL statement
order by s.sql_id, bc.position;

这篇关于如何在从 v$sql 收到的 Oracle 查询中查找参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 11:33