Solved

capture oracle bind_variable value_string null

Posted on 2014-02-27
4
1,014 Views
Last Modified: 2014-03-10
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
0
Comment
Question by:bibi92
  • 3
4 Comments
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39892754
I've not used DBA_HIST_SQLBIND.

Whenever I've looked up bind variables I've used v$sql_bind_capture
0
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
ID: 39892781
dba_hist_sqlbind isn't exhaustive.  It's only captures snapshots - as represented by the SNAP_ID column.

You can try to look in v$sql_bind_capture if you ran your query recently but even that isn't guaranteed.

There's even a column for that "WAS_CAPTURED" which, if NO, means it wasn't captured
0
 
LVL 73

Expert Comment

by:sdstuber
ID: 39892798
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.
0
 
LVL 73

Expert Comment

by:sdstuber
ID: 39917902
A split is probably in order here.

slightwv also posted  v$sql_bind_capture, but before me
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now