獲取oracle正在處於等待狀態的sql語句的執行計劃的語句
col operation format a50
col cost format 999999
col kbytes format 999999
col object format a20
select hash_value,child_number,
lpad('',2*depth)
||operation
||''
||options
||decode(id,0,substr(optimizer,1,6)||'Cost='||to_char(cost))operation,
object_name,object_type,cost,round(bytes/1024) kbytes
from v$sql_plan where hash_value in(
select a.sql_hash_value
from v$session a,v$session_wait b
where a.sid=b.sid
and b.event='db file sequential read')
order by hash_value,child_number,ID;
SQL> col operation format a55
SQL> col cost format 99999
SQL> col kbytes format 999999
SQL> col object format a25
SQL> select hash_value,child_number,
2 lpad('',2*depth)
3 ||operation
4 ||''
5 ||options
6 ||decode(id,0,substr(optimizer,1,6)||'Cost='||to_char(cost))operation,
7 object_name,object_type,cost,round(bytes/1024) kbytes
8 from v$sql_plan where hash_value in(
9 select a.sql_hash_value
10 from v$session a,v$session_wait b
11 where a.sid=b.sid
12 and b.event='db file sequential read')
13 order by hash_value,child_number,ID;
HASH_VALUE CHILD_NUMBER OPERATION OBJECT_NAME OBJECT_TYPE COST KBYTES
---------- ------------ ------------------------------------------------------- ------------------------------ ---------------------------------------- ----- ------
1722201563 0 SELECT STATEMENTFIRST_Cost=203255 20325
5
1722201563 0 SORTORDER BY 20325 5910
5
1722201563 0 HASHGROUP BY 20325 5910
5
1722201563 0 HASH JOIN 20193 5910
1
1722201563 0 TABLE ACCESSFULL BS_CORP TABLE 85 41
1722201563 0 NESTED LOOPSSEMI 20184 4561
5
1722201563 0 HASH JOIN 20184 4540
3
1722201563 0 HASH JOIN 19970 2515
4
1722201563 0 HASH JOIN 19529 1813
2
1722201563 0 HASH JOINRIGHT SEMI 19442 489
1
1722201563 0 VIEW VW_SQ_1 VIEW 19402 36
8
1722201563 0 FILTER
1722201563 0 NESTED LOOPS 19402 241
8
1722201563 0 NESTED LOOPS 19402 157
6
1722201563 0 MERGE JOINCARTESIAN 28436 264415
1722201563 0 INLIST ITERATOR
1722201563 0 INDEXRANGE SCAN PK_BS_CORP INDEX (UNIQUE) 4 0
1722201563 0 BUFFERSORT 28432 5509
1722201563 0 TABLE ACCESSFULL LV_BUSI_RECORD TABLE 862 5509
1722201563 0 TABLE ACCESSBY INDEX ROWID BS_FAMILY TABLE 19402 0
6
HASH_VALUE CHILD_NUMBER OPERATION OBJECT_NAME OBJECT_TYPE COST KBYTES
---------- ------------ ------------------------------------------------------- ------------------------------ ---------------------------------------- ----- ------
1722201563 0 BITMAP CONVERSIONTO ROWIDS
1722201563 0 BITMAP AND
1722201563 0 BITMAP CONVERSIONFROM ROWIDS
1722201563 0 INDEXRANGE SCAN PK_BS_FAMILY INDEX (UNIQUE) 1
1722201563 0 BITMAP CONVERSIONFROM ROWIDS
1722201563 0 INDEXRANGE SCAN IDX_BS_FAMILY_CORP_ID INDEX 1
1722201563 0 INDEXRANGE SCAN INDEX_FAMILY_ID INDEX 1 0
1722201563 0 TABLE ACCESSFULL LV_BUSI_BILL TABLE 393 847
1722201563 0 TABLE ACCESSFULL LV_BUSI_RECORD TABLE 867 15524
1722201563 0 TABLE ACCESSFULL BS_FAMILY TABLE 4407 23768
1722201563 0 TABLE ACCESSFULL LV_BUSI_ASSIGN TABLE 913 12421
1722201563 0 INDEXRANGE SCAN INDEX_FAMILY_ID INDEX 1 3236
1722201563 1 SELECT STATEMENTFIRST_Cost=197255 19725
5
1722201563 1 SORTORDER BY 19725 907
5
1722201563 1 HASHGROUP BY 19725 907
5
1722201563 1 HASH JOIN 19704 907
8
1722201563 1 HASH JOIN 19613 516
0
1722201563 1 TABLE ACCESSFULL BS_CORP TABLE 85 41
1722201563 1 NESTED LOOPSSEMI 19604 389
4
1722201563 1 NESTED LOOPS 19604 386
3
1722201563 1 NESTED LOOPS 19488 278
0
HASH_VALUE CHILD_NUMBER OPERATION OBJECT_NAME OBJECT_TYPE COST KBYTES
---------- ------------ ------------------------------------------------------- ------------------------------ ---------------------------------------- ----- ------
1722201563 1 HASH JOINSEMI 19442 75
1
1722201563 1 TABLE ACCESSFULL LV_BUSI_BILL TABLE 392 70
1722201563 1 VIEW VW_SQ_1 VIEW 19402 36
8
1722201563 1 FILTER
1722201563 1 NESTED LOOPS 19402 241
8
1722201563 1 NESTED LOOPS 19402 157
6
1722201563 1 MERGE JOINCARTESIAN 28436 264415
1722201563 1 INLIST ITERATOR
1722201563 1 INDEXRANGE SCAN PK_BS_CORP INDEX (UNIQUE) 4 0
1722201563 1 BUFFERSORT 28432 5509
1722201563 1 TABLE ACCESSFULL LV_BUSI_RECORD TABLE 862 5509
1722201563 1 TABLE ACCESSBY INDEX ROWID BS_FAMILY TABLE 19402 0
6
1722201563 1 BITMAP CONVERSIONTO ROWIDS
1722201563 1 BITMAP AND
1722201563 1 BITMAP CONVERSIONFROM ROWIDS
1722201563 1 INDEXRANGE SCAN PK_BS_FAMILY INDEX (UNIQUE) 1
1722201563 1 BITMAP CONVERSIONFROM ROWIDS
1722201563 1 INDEXRANGE SCAN IDX_BS_FAMILY_CORP_ID INDEX 1
1722201563 1 INDEXRANGE SCAN INDEX_FAMILY_ID INDEX 1 0
1722201563 1 TABLE ACCESSBY INDEX ROWID LV_BUSI_RECORD TABLE 1 0
1722201563 1 INDEXRANGE SCAN IDX_BUSI_BILL_BILLSN INDEX 1
HASH_VALUE CHILD_NUMBER OPERATION OBJECT_NAME OBJECT_TYPE COST KBYTES
---------- ------------ ------------------------------------------------------- ------------------------------ ---------------------------------------- ----- ------
1722201563 1 TABLE ACCESSBY INDEX ROWID BS_FAMILY TABLE 1 0
1722201563 1 INDEXUNIQUE SCAN PK_BS_FAMILY INDEX (UNIQUE) 1
1722201563 1 INDEXRANGE SCAN INDEX_FAMILY_ID INDEX 1 3236
1722201563 1 TABLE ACCESSFULL LV_BUSI_ASSIGN TABLE 913 12421
66 rows selected
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26015009/viewspace-752560/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 獲取oracle sql語句詳細些執行計劃OracleSQL
- Laravel 獲取執行的sql語句LaravelSQL
- 查詢Oracle正在執行的SQL語句OracleSQL
- 清除SQL語句的執行計劃SQL
- 查詢Oracle正在執行的sql語句及執行該語句的使用者OracleSQL
- 通過分析SQL語句的執行計劃優化SQL語句SQL優化
- 根據SQL Id獲得SQL語句的執行計劃SQL
- 獲得目標SQL語句執行計劃的方法SQL
- 查詢正在執行的SQL語句SQL
- 查詢正在執行的sql語句及該語句執行的時間SQL
- 查詢Oracle正在執行和執行過的SQL語句OracleSQL
- 檢視mysql正在執行的SQL語句MySql
- 使用 EXPLAIN PLAN 獲取SQL語句執行計劃 (R0.1)AISQL
- Oracle 查詢某個session正在執行的sql語句OracleSessionSQL
- 檢視當前oracle中正在執行的sql語句OracleSQL
- Oracle SQL 語句的執行過程OracleSQL
- 使用dbms_xplan包來獲得sql語句的執行計劃SQL
- oracle之 v$sql_monitor 監視正在執行的SQL語句的統計資訊OracleSQL
- 指令碼:獲得現有語句的執行計劃指令碼
- 【檢視】使用V$SQL_PLAN檢視獲取曾經執行過的SQL語句執行計劃SQL
- 一條SQL語句的執行計劃變化探究SQL
- sql語句如何執行的SQL
- 執行大的sql語句SQL
- 理解oracle執行sql語句的過程OracleSQL
- 通過分析SQL語句的執行計劃優化SQL 二SQL優化
- oracle查詢語句執行計劃中的表消除Oracle
- Mybatis 動態執行SQL語句MyBatisSQL
- 【Gp】PostgreSql中如何kill掉正在執行的sql語句SQL
- 查詢當前正在執行的SQL語句並KILLSQL
- ORACLE 11G 使用SPM來調整SQL語句的執行計劃OracleSQL
- mysql的sql語句執行流程MySql
- SQL 語句的執行順序SQL
- oracle的sql語句OracleSQL
- 通過分析SQL語句的執行計劃優化SQL(總結)SQL優化
- 後臺執行SQL語句(oracle)SQLOracle
- Oracle SQL語句執行步驟OracleSQL
- Oracle 獲取ddl語句Oracle
- oracle動態sql語句處理(轉)OracleSQL