How to find bind variables for a sql in Oracle: Easy steps

find bind variables for a sql

Today in this article, we will see how to find bind variables for a sql in Oracle database. Let’s go through the steps.

Bind variables in Oracle are used for :

  • Storing return codes
  • Improving query performance
  • Reusing statements
  • Allowing for soft parsing of SQL queries

Steps to find bind variables for a sql  :

Issue the below Queries to find bind variables details :

  SELECT NAME,POSITION,DATATYPE_STRING,VALUE_STRING
FROM v$sql_bind_capture WHERE sql_id='xxxxxxxxxxx';
 SELECT sql_id, NAME,DATATYPE_STRING,VALUE_STRING
FROM DBA_HIST_SQLBIND WHERE SQL_ID='xxxxxxxxxx' ;

Also, you can get the bind variables for SQLID from the ora-600 trace file. For this, you can refer the Oracle Doc ID 2542091.1

Other Reference Articles :

Leave a Reply