對於帶有綁定變量的SQL語句
PEEK之後
SQL> SELECT COUNT(
COUNT(
SQL> DESC TEST;
Name Null? Type
OWNER VARCHAR
NAME VARCHAR
TYPE VARCHAR
LINE NUMBER
TEXT VARCHAR
SQL> SELECT LINE
LINE COUNT(
SQL> VARIABLE LINE NUMBER
SQL> EXEC :LINE:=
PL/SQL procedure successfully completed
SQL> SELECT COUNT(
COUNT(
SQL> COL SQL_ID FORMAT A
SQL> COL BIND_DATA FORMAT A
SQL> SELECT SQL_ID
SQL_ID BIND_DATA
abhf
SQL> SELECT VALUE_STRING FROM TABLE(DBMS_SQLTUNE
VALUE_STRING
SQL> SELECT * FROM TABLE(DBMS_XPLAN
PLAN_TABLE_OUTPUT
SQL_ID abhf
SELECT COUNT(
Plan hash value:
| Id | Operation | Name | Rows | Bytes | Cost |
|
|
|*
Predicate Information (identified by operation id):
Note
SQL> EXEC :LINE:=
PL/SQL procedure successfully completed
SQL> SELECT COUNT(
COUNT(
SQL> ALTER SYSTEM FLUSH SHARED_POOL;
System altered
SQL> SELECT COUNT(
COUNT(
SQL> SELECT SQL_ID
SQL_ID BIND_DATA
abhf
SQL> SELECT VALUE_STRING FROM TABLE(DBMS_SQLTUNE
VALUE_STRING
SQL> PRINT:
LINE
SQL> EXEC :LINE:=
PL/SQL procedure successfully completed
SQL> SELECT COUNT(
COUNT(
SQL> SELECT SQL_ID
SQL_ID BIND_DATA
abhf
SQL> SELECT VALUE_STRING FROM TABLE(DBMS_SQLTUNE
VALUE_STRING
對於隨後的綁定變量的捕獲
為了演示的方便
SQL> alter system set
System altered
SQL> exec :LINE:=
PL/SQL procedure successfully completed
SQL> SELECT COUNT(
COUNT(
SQL> EXEC :LINE:=
PL/SQL procedure successfully completed
SQL> SELECT COUNT(
COUNT(
SQL> EXEC :LINE:=
PL/SQL procedure successfully completed
SQL> SELECT COUNT(
COUNT(
SQL> SELECT VALUE_STRING FROM V$SQL_BIND_CAPTURE WHERE SQL_ID=
VALUE_STRING
SQL> EXEC :LINE:=
PL/SQL procedure successfully completed
SQL> SELECT VALUE_STRING FROM V$SQL_BIND_CAPTURE WHERE SQL_ID=
VALUE_STRING
SQL> SELECT VALUE_STRING FROM V$SQL_BIND_CAPTURE WHERE SQL_ID=
VALUE_STRING
SQL> EXEC :LINE:=
PL/SQL procedure successfully completed
SQL> SELECT VALUE_STRING FROM V$SQL_BIND_CAPTURE WHERE SQL_ID=
VALUE_STRING
不知道為什麼
From:http://tw.wingwit.com/Article/program/Oracle/201311/18232.html