計劃散列存儲在其中一個PLAN_TABLE行的OTHER_XML列中。
抽樣方案
explain plan set statement_id = 'TEST3' for select * from dual connect by level <= 10;
select * from table(dbms_xplan.display);
Plan hash value: 2874664061
-------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 2 | 2 (0)| 00:00:01 |
|* 1 | CONNECT BY WITHOUT FILTERING| | | | | |
| 2 | TABLE ACCESS FULL | DUAL | 1 | 2 | 2 (0)| 00:00:01 |
-------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter(LEVEL<=10)
查詢提取PLAN_HASH
select extractValue(xmltype(other_xml), '/other_xml/info[@type="plan_hash"]') plan_hash
from plan_table
where other_xml is not null
and statement_id = 'TEST3';
PLAN_HASH
---------
2874664061
它的工作。非常感謝你! – user2804064