Link to home
Start Free TrialLog in
Avatar of bibi92
bibi92Flag for France

asked on

capture oracle bind_variable value_string null

Hello,

How can I capture bind variable for sql_id. I have tested the following script but the value_string is null and the sattistics level is typical.

select  sql_id,  t.sql_text SQL_TEXT,  b.name BIND_NAME,  b.value_string BIND_STRING
from  v$sql t  join DBA_HIST_SQLBIND b  using (sql_id)
where  b.value_string is not null  and sql_id='d4yj18kvu48j2'
/

Thanks
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

I've not used DBA_HIST_SQLBIND.

Whenever I've looked up bind variables I've used v$sql_bind_capture
ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you want to be sure to capture all binds ever used then trace your session with bind capture on then run your query and check the file.

obviously, this isn't something you'd have turned on all the time.
A split is probably in order here.

slightwv also posted  v$sql_bind_capture, but before me