Subscribe to Posts by Email

Subscriber Count

    696

Disclaimer

All information is offered in good faith and in the hope that it may be of use for educational purpose and for Database community purpose, but is not guaranteed to be correct, up to date or suitable for any particular purpose. db.geeksinsight.com accepts no liability in respect of this information or its use. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content and if notify any such I am happy to remove. Product and company names mentioned in this website may be the trademarks of their respective owners and published here for informational purpose only. This is my personal blog. The views expressed on these pages are mine and learnt from other blogs and bloggers and to enhance and support the DBA community and this web blog does not represent the thoughts, intentions, plans or strategies of my current employer nor the Oracle and its affiliates or any other companies. And this website does not offer or take profit for providing these content and this is purely non-profit and for educational purpose only. If you see any issues with Content and copy write issues, I am happy to remove if you notify me. Contact Geek DBA Team, via geeksinsights@gmail.com

Pages

Finding SQL Bind variables and its literal values

Hi,

In 10g, you can use data dictionary view v$sql_bind_capture or AWR view dba_hist_sqlbind (historical version of v$sql_bind_capture) to find bind variables’ values. However it has some significant limitations:

  • Captured periodically (_cursor_bind_capture_interval=900 seconds by default), not at real time.
  • Captured under maximum size(_cursor_bind_capture_area_size=400)
  • Only bind variables in WHERE clause are captured (e.g bind variables passed to function are not captured !)

    select name, position, datatype_string, value_string from v$sql_bind_capture where sql_id = '';

    But there is a bug related to v$sql_bind_capture as reported in note 444551.1

    V$SQL_BIND_CAPTURE Does Not Show The Value For Binds Of Type TIMESTAMP [ID 444551.1] as a workaround you can get value of TIMESTAMP bind variable by

    select name, position, datatype_string, was_captured, value_string, anydata.accesstimestamp(value_anydata) from v$sql_bind_capture where sql_id = '';

    top

    it’s fixed in 11.2.

    -Thanks
    Geek DBA

  • 2 comments to Finding SQL Bind variables and its literal values