Solved

capture oracle bind_variable value_string null

Posted on 2014-02-27
4
1,075 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 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 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
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.

696 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