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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 9i and 10g 通過SQL_ADDRESS 或sql_id查詢執行計劃SQL
- 透過查詢檢視sql執行計劃SQL
- SQL效能的度量 - 透過v$sql_plan查詢執行計劃SQL
- explain 查詢執行計劃AI
- 10g和9i執行計劃差異
- 執行計劃-6:推入子查詢
- oracle查詢sql執行耗時、執行時間、sql_idOracleSQL
- 根據SQL_ID檢視執行計劃SQL
- 9i 升級到 10g SQL執行計劃校驗SQL
- 透過SQL_ID檢視SQL歷史執行資訊SQL
- 透過dbms_xplan.display察看執行計劃
- 通過等待事件來獲得查詢SQl的執行計劃事件SQL
- 透過DMV查詢CPU時間最長的語句和查詢計劃
- 9i奇怪的AJ執行計劃
- Oracle檢視sql_id 的歷史執行計劃OracleSQL
- MySQL中in(獨立子查詢)的執行計劃MySql
- 透過作業系統PID查詢執行的SQL作業系統SQL
- 在MySQL中使用explain查詢SQL的執行計劃MySqlAI
- [oracle] 查詢歷史會話、歷史執行計劃Oracle會話
- oracle查詢語句執行計劃中的表消除Oracle
- 透過10053事件分析一個SQL執行計劃事件SQL
- 透過SPM手動新增執行計劃到baseLine
- oracle 10g執行計劃 (轉帖)Oracle 10g
- 透過執行計劃中的CONCATENATION分析sql問題SQL
- 透過shell指令碼來得到不穩定的執行計劃指令碼
- 【執行計劃】Oracle 11gR2使用Full outer Joins執行計劃完成全外連線查詢Oracle
- PostgreSQL 查詢當前執行中sql的執行計劃——pg_show_plans模組SQL
- Oracle 9i 開啟autotrace on 檢視執行計劃Oracle
- 基於UNION ALL的分頁查詢執行計劃問題
- SYS_CONNECT_BY_PATH函式在9i,10G下導致執行計劃改變函式
- 10G中檢視歷史執行計劃資訊
- 基於UNION ALL的分頁查詢執行計劃問題(二)
- 查詢Oracle正在執行和執行過的SQL語句OracleSQL
- SQL效能的度量 - 透過explain和dbms_xplan包分析執行計劃SQLAI
- 透過分析SQL語句的執行計劃最佳化SQL(總結)SQL
- Linux透過計劃任務驅動Windows伺服器執行命令LinuxWindows伺服器
- MySQL學習 - 查詢的執行過程MySql
- 查詢SQLSERVER執行過的SQL記錄SQLServer