Oracle Autotrace
AUTOTRACE
SQL> conn scott/tiger
SQL> set autotrace on
SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled
SP2-0611: Error enabling STATISTICS report
SQL> @$ORACLE_HOME/sqlplus/admin/plustrce.sql
SQL> grant plustrace to scott;
SQL> conn scott/tiger
顯示結果集以及執行計劃
SQL> set autotrace on
不顯示結果集,顯示執行計劃
SQL> set autotrace traceonly
SQL> select * from dept
2 minus
3 select * from dept1;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
30 SALES CHICAGO
40 OPERATIONS BOSTON
Execution Plan
----------------------------------------------------------
Plan hash value: 1627988746
-----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-----------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 4 | 150 | 8 (63)| 00:00:01 |
| 1 | MINUS | | | | | |
| 2 | SORT UNIQUE | | 4 | 120 | 4 (25)| 00:00:01 |
| 3 | TABLE ACCESS FULL| DEPT | 4 | 120 | 3 (0)| 00:00:01 |
| 4 | SORT UNIQUE | | 1 | 30 | 4 (25)| 00:00:01 |
| 5 | TABLE ACCESS FULL| DEPT1 | 1 | 30 | 3 (0)| 00:00:01 |
-----------------------------------------------------------------------------
................
SQL> select * from dept where deptno not in(select deptno from dept1);
DEPTNO DNAME LOC
---------- -------------- -------------
30 SALES CHICAGO
40 OPERATIONS BOSTON
10 ACCOUNTING NEW YORK
Execution Plan
----------------------------------------------------------
Plan hash value: 1948948592
----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 4 | 172 | 7 (15)| 00:00:01 |
|* 1 | HASH JOIN ANTI NA | | 4 | 172 | 7 (15)| 00:00:01 |
| 2 | TABLE ACCESS FULL| DEPT | 4 | 120 | 3 (0)| 00:00:01 |
| 3 | TABLE ACCESS FULL| DEPT1 | 1 | 13 | 3 (0)| 00:00:01 |
----------------------------------------------------------------------------
............
SQL> select * from dept a,dept1 b where a.deptno=b.deptno(+) and b.deptno is null;
DEPTNO DNAME LOC DEPTNO DNAME LOC
---------- -------------- ------------- ---------- -------------- -------------
30 SALES CHICAGO
40 OPERATIONS BOSTON
10 ACCOUNTING NEW YORK
Execution Plan
----------------------------------------------------------
Plan hash value: 2254963940
-----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-----------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 60 | 7 (15)| 00:00:01 |
|* 1 | FILTER | | | | | |
|* 2 | HASH JOIN OUTER | | 1 | 60 | 7 (15)| 00:00:01 |
| 3 | TABLE ACCESS FULL| DEPT | 4 | 120 | 3 (0)| 00:00:01 |
| 4 | TABLE ACCESS FULL| DEPT1 | 1 | 30 | 3 (0)| 00:00:01 |
-----------------------------------------------------------------------------
.........
歡迎關注我的微信公眾號"IT小Chen",共同學習,共同成長!!!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29785807/viewspace-1467540/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 關於ORACLE AUTOTRACEOracle
- ORACLE 使用AUTOTRACE功能Oracle
- ORACLE 10G AUTOTRACEOracle 10g
- Oracle最佳化工具——AutoTraceOracle
- oracle之autotrace統計資訊分析Oracle
- oracle 9i 開啟autotrace onOracle
- Oracle 9I 下的AutoTraceOracle
- 【優化】ORACLE set autotrace in SQL*Plus優化OracleSQL
- 【AUTOTRACE】SQL優化的重要工具--AUTOTRACESQL優化
- oracle 10g R2 autotrace 增強Oracle 10g
- (轉)oracle效能工具包Explain plan、Autotrace、TkprofOracleAI
- set autotrace in SQL*PlusSQL
- Autotrace 用法總結
- oracle10g_10.2.0.1_sql tuning_set autotrace配置OracleSQL
- Oracle 9i 開啟autotrace on 檢視執行計劃Oracle
- Autotrace的配置與分析
- set autotrace on [configure]
- Oracle 開啟SQL跟蹤執行SET AUTOTRACE ON命令時出錯OracleSQL
- 設定autotrace全過程
- 安裝並設定autotrace
- Autotrace的設定與使用
- Set autotrace命令及解釋
- 設定sql plus 的autotraceSQL
- Oracle autotrace 報 SP2-0618 PLUSTRACE role 問題解決Oracle
- oracle 9i for linux 9.2.0.4 中開啟autotrace中的一個bug。OracleLinux
- 自動設定autotrace環境
- 核心表AUTOTRACE結果出錯
- 獲取執行計劃之Autotrace
- Autotrace工具使用——小工具,大用場
- 開啟執行計劃set autotrace on
- 使用者autotrace 無法使用解決
- set autotrace的用法和含意及區別
- EXPLAIN PLAN and SQL*PLUS AUTOTRACE may not generate actual plansAISQL
- autotrace explain plan 相關引數解釋AI
- 檢視sql執行計劃--set autotraceSQL
- 如何啟用sqlplus的AutoTrace功能SQL
- EXPLAIN PLAN FOR 和 SET AUTOTRACE之間的差別AI
- 設定autotrace的報錯問題解決