When diagnosing a performance problem with SQL, we sometimes need to get the actual value of its bound variable, and then bring the actual value into the SQL statement, make a SELECT statement with the original SQL (with the Where condition), actually execute it, and see what the selectivity is.
This is the way to get the value of its bound variable. The writing of this article has been helped by withered flourish elders, and I thank you for that.
This article applies to DB with Oracle 10G or later.
Alter session Set Nls_date_format = ' Yyyy-mm-dd,hh24:mi:ss '; set linesize 400col sql_id format a20col name format A20col da tatype_string format a14col value_string format A20-this SQL reads bound variable value information from memory, if not in memory, uses the next sqlselect sql_id,name, datatype _string, last_captured,value_string from v$sql_bind_capture where sql_id= 'DXFCACN4T4PPW' ORDER by Last_captured,position; --This SQL reads the binding variable value information from the AWR select Instance_number, Sql_id,name, datatype_string, last_captured,value_string from Dba_hist_ SQLBind where sql_id= 'Fahv8x6ngrb50' ORDER by Last_captured,position;