Bind values over time

Need to find out the bind variable values for a certain query over time? The following script prompts for an SQL_ID and shows you all bind values found within the AWP reports:

select 
sn.END_INTERVAL_TIME,
sb.NAME,
sb.VALUE_STRING 
from 
DBA_HIST_SQLBIND sb,
DBA_HIST_SNAPSHOT sn
where 
sb.sql_id='&sql' and
sb.WAS_CAPTURED='YES' and
sn.snap_id=sb.snap_id
order by 
sb.snap_id,
sb.NAME;

Leave a Reply