?
Solved

capture oracle bind_variable value_string null

Posted on 2014-02-27
4
Medium Priority
?
1,168 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 77

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 74

Accepted Solution

by:
sdstuber earned 2000 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 74

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 74

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
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.
Suggested Courses

764 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