DBA_HIST_SQLBIND displays historical information on bind variables used by SQL cursors. This view contains snapshots of V$SQL_BIND_CAPTURE.
2,
select plan_table_output
from table(dbms_xplan.display_awr('an08qa6xyhy4b',
null,
null,
'ADVANCED +PEEKED_BINDS'));
select plan_table_output
from table(dbms_xplan.display_cursor('an08qa6xyhy4b',
0,
'ADVANCED +PEEKED_BINDS'));
通过设置 dbms_xplan 包下函数的 format 为 'ADVANCED +PEEKED_BINDS' 可以查看到绑定变量。
3,
SQL> oradebug setmypid
Statement processed.
SQL> alter session set events '10046 trace name context forever, level 4';
Session altered.
SQL> var a varchar2(20);
SQL> exec :a := 'T5';
PL/SQL procedure successfully completed.
SQL> select table_NAME from user_tables where table_NAME=:a;
TABLE_NAME
------------------------------
T5
SQL> oradebug tracefile_name
/u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_13276.trc
SQL>
通过设置 10046 可以看到绑定变量。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25475140/viewspace-748985/ ,如需转载,请注明出处,否则将追究法律责任。