代码改变世界

oracle查看sql中的绑定变量

2022-05-24 15:56  abce  阅读(424)  评论(0编辑  收藏  举报
alter session set nls_date_format = 'yyyy-mm-dd,hh24:mi:ss';

set linesize 300
col sql_Id format a25
col name format a25
col datatype_string format a20
col value_string format a20

#sql还在shared pool中
select sql_id, name, datatype_string, last_captured, value_string
  from v$sql_bind_capture
 where sql_id = 'xxxxxxxxxxxxxxx'
 order by LAST_CAPTURED, POSITION; 
 
 
#从awr中查看
select instance_number,
       sql_id,
       name,
       datatype_string,
       last_captured,
       value_string
  from dba_hist_sqlbind
 where sql_id = 'xxxxxxxxxxxxxxx'
 order by LAST_CAPTURED, POSITION;