9i and 10g 透過SQL_ADDRESS 或sql_id查詢執行計劃
V$SQL_PLAN, DBMS_XPLAN.DISPLAY_CURSOR:
If you know sql_id or the set of (hash_value, address) of the shared cursor, you can get the correct plan using V$SQL_PLAN or DBMS_XPLAN.DISPLAY_CURSOR. Make sure the calling user has privileges on fixed following views: V$SQL_PLAN_STATISTICS_ALL, V$SQL and V$SQL_PLAN.
-- For 9i and later
col operation for a20
col object_name for a20
col options for a20
col optimizer for a12
col child_number a3
SELECT child_number, id , lpad (' ', depth) || operation operation , options , object_name , optimizer , cost
FROM V$SQL_PLAN
WHERE hash_value = &hash_value
AND address = '&address'
ORDER BY child_number, id;
-- For 10g and later
col operation for a20
col object_name for a20
col options for a20
col optimizer for a12
col child_number a3
SELECT child_number, id , lpad (' ', depth) || operation operation , options , object_name , optimizer , cost
FROM V$SQL_PLAN
WHERE sql_id = '&sql_id'
ORDER BY child_number, id;
select * from table(dbms_xplan.display_cursor('&sql_id', NULL, 'ALL'));
If you know sql_id or the set of (hash_value, address) of the shared cursor, you can get the correct plan using V$SQL_PLAN or DBMS_XPLAN.DISPLAY_CURSOR. Make sure the calling user has privileges on fixed following views: V$SQL_PLAN_STATISTICS_ALL, V$SQL and V$SQL_PLAN.
-- For 9i and later
col operation for a20
col object_name for a20
col options for a20
col optimizer for a12
col child_number a3
SELECT child_number, id , lpad (' ', depth) || operation operation , options , object_name , optimizer , cost
FROM V$SQL_PLAN
WHERE hash_value = &hash_value
AND address = '&address'
ORDER BY child_number, id;
-- For 10g and later
col operation for a20
col object_name for a20
col options for a20
col optimizer for a12
col child_number a3
SELECT child_number, id , lpad (' ', depth) || operation operation , options , object_name , optimizer , cost
FROM V$SQL_PLAN
WHERE sql_id = '&sql_id'
ORDER BY child_number, id;
select * from table(dbms_xplan.display_cursor('&sql_id', NULL, 'ALL'));
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31520497/viewspace-2156891/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- explain 查詢執行計劃AI
- oracle查詢sql執行耗時、執行時間、sql_idOracleSQL
- 執行計劃-6:推入子查詢
- Oracle檢視sql_id 的歷史執行計劃OracleSQL
- 在MySQL中使用explain查詢SQL的執行計劃MySqlAI
- [oracle] 查詢歷史會話、歷史執行計劃Oracle會話
- PostgreSQL 查詢當前執行中sql的執行計劃——pg_show_plans模組SQL
- Linux透過計劃任務驅動Windows伺服器執行命令LinuxWindows伺服器
- MySQL學習 - 查詢的執行過程MySql
- TiDB 查詢優化及調優系列(四)查詢執行計劃的調整及優化原理TiDB優化
- Oracle 9i變數窺視引起執行計劃異常故障報告Oracle變數
- 執行計劃-1:獲取執行計劃
- GaussDB SQL查詢語句執行過程解析SQL
- MySQL 查詢語句執行過程淺析MySql
- 透過空間佔用和執行計劃瞭解SQL Server的行儲存索引SQLServer索引
- 【SQL_PLAN】Oracle 透過檢視sql_plan 格式化執行計劃SQLOracle
- 多執行緒查詢執行緒
- 如何用GNU time查詢Linux命令或程式的執行時間Linux
- 分析執行計劃優化SQLORACLE的執行計劃(轉)優化SQLOracle
- Oracle 通過註釋改變執行計劃Oracle
- MySQL——通過EXPLAIN分析SQL的執行計劃MySqlAI
- 20180427通過SQL_ID查出執行該SQL客戶端IPSQL客戶端
- MySQL執行計劃MySql
- SYBASE執行計劃
- MySQL 執行計劃MySql
- 透過遞迴查詢應用依賴遞迴
- 透過手機號查詢繫結QQ
- 如何透過Android手機查詢IP地址Android
- 如何查詢一個儲存過程是否在執行儲存過程
- 【執行計劃】Oracle獲取執行計劃的幾種方法Oracle
- 透過WHQL的產品如何在微軟官網進行查詢微軟
- MySQL查詢優化之優化器工作流程以及優化的執行計劃生成MySql優化
- 007 Rust 非同步程式設計,透過 join 執行 FutureRust非同步程式設計
- MySQL執行計劃解析MySql
- mysql explain 執行計劃MySqlAI
- explain執行計劃分析AI
- mysql執行計劃explainMySqlAI
- oracle 固定執行計劃Oracle