set autotrace in SQL*Plus
set autotrace off
set autotrace on
set autotrace traceonly
set autotrace on explain
set autotrace on statistics
set autotrace on explain statistics
set autotrace traceonly explain
set autotrace traceonly statistics
set autotrace traceonly explain statistics
set autotrace off explain
set autotrace off statistics
set autotrace off explain statistics
Setting autotrace allows to display some statistics and/or an query execution plan for DML statements.
set autotrace on: Shows the execution plan as well as statistics of the statement.
set autotrace on explain: Displays the execution plan only.
set autotrace on statistics: Displays the statistics only.
set autotrace traceonly: Displays the execution plan and the statistics (as set autotrace on does), but doesn't print a query's result.
set autotrace off: Disables all autotrace
If autotrace is enabled with statistics, then the following statistics are displayed:
* recursive calls
* db block gets
* consistent gets
* physical reads
* redo size
* bytes sent via SQL*Net to client
* bytes received via SQL*Net from client
* SQL*Net roundtrips to/from client
* sorts (memory)
* sorts (disk)
Additionally, there is rows processed which is not found in v$statname.
Prerequisites
The explain plan feature of autotrace requires a plan_table which can be created with $ORACLE_HOME/rdbms/admin/utlxplan.sql
The statistic feature requires that the user is granted select on v_$sesstat, v_$statname and v_$session.
An Oracle installation comes with $ORACLE_HOME/sqlplus/admin/plustrce.sql which installs the role plustrace. plustrace is granted those select rights. If now plustrace is granted to a user, he will then be able to turn autotrace on. Alternatively, plustrace can be granted to public.
[@more@]autotrace
set autotrace on
set autotrace traceonly
set autotrace on explain
set autotrace on statistics
set autotrace on explain statistics
set autotrace traceonly explain
set autotrace traceonly statistics
set autotrace traceonly explain statistics
set autotrace off explain
set autotrace off statistics
set autotrace off explain statistics
Setting autotrace allows to display some statistics and/or an query execution plan for DML statements.
set autotrace on: Shows the execution plan as well as statistics of the statement.
set autotrace on explain: Displays the execution plan only.
set autotrace on statistics: Displays the statistics only.
set autotrace traceonly: Displays the execution plan and the statistics (as set autotrace on does), but doesn't print a query's result.
set autotrace off: Disables all autotrace
If autotrace is enabled with statistics, then the following statistics are displayed:
* recursive calls
* db block gets
* consistent gets
* physical reads
* redo size
* bytes sent via SQL*Net to client
* bytes received via SQL*Net from client
* SQL*Net roundtrips to/from client
* sorts (memory)
* sorts (disk)
Additionally, there is rows processed which is not found in v$statname.
Prerequisites
The explain plan feature of autotrace requires a plan_table which can be created with $ORACLE_HOME/rdbms/admin/utlxplan.sql
The statistic feature requires that the user is granted select on v_$sesstat, v_$statname and v_$session.
An Oracle installation comes with $ORACLE_HOME/sqlplus/admin/plustrce.sql which installs the role plustrace. plustrace is granted those select rights. If now plustrace is granted to a user, he will then be able to turn autotrace on. Alternatively, plustrace can be granted to public.
[@more@]autotrace
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26651/viewspace-1038066/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【優化】ORACLE set autotrace in SQL*Plus優化OracleSQL
- 設定sql plus 的autotraceSQL
- 檢視sql執行計劃--set autotraceSQL
- EXPLAIN PLAN and SQL*PLUS AUTOTRACE may not generate actual plansAISQL
- SQL*PLUS命令, set命令大全SQL
- 檢視sql執行計劃--set autotrace [final]SQL
- set autotrace on [configure]
- SQL*Plus Set引數詳解SQL
- Set autotrace命令及解釋
- oracle10g_10.2.0.1_sql tuning_set autotrace配置OracleSQL
- 【SQL/PLUS】Oracle PL/SQL程式設計用set serveroutput onSQLOracle程式設計Server
- Oracle 開啟SQL跟蹤執行SET AUTOTRACE ON命令時出錯OracleSQL
- 【AUTOTRACE】SQL優化的重要工具--AUTOTRACESQL優化
- Sql最佳化(十八) 調優工具(1)set autotrace和excute plan tableSQL
- 開啟執行計劃set autotrace on
- set autotrace的用法和含意及區別
- EXPLAIN PLAN FOR 和 SET AUTOTRACE之間的差別AI
- 如何啟用sqlplus的AutoTrace功能SQL
- sqlplus : set autot traceonly vs pl/sql developer : F5SQLDeveloper
- sqlplus set命令SQL
- 以scott使用者執行set autotrace 出錯
- sql中使用函式導致explain plan for和set autotrace得到執行計劃不準確SQL函式AI
- 使用set autotrace on 檢視資料庫執行計劃資料庫
- set autotrace on 產生不準確的執行計劃
- sqlplus set命令使用SQL
- set autotrace的選項和計劃報告的屬性
- sqlplus常用set指令(轉)SQL
- cmd_sqlplus:set head off and set head onSQL
- SQLPLUS中autotrace traceonly stat統計資訊解讀SQL
- sql tuning setSQL
- 【實驗】使用SQL*Plus中set命令格式化SPOOL匯出的檔案SQL
- SQLPLUS之set常用設定SQL
- SQL效能的度量 - 語句級別的SQL跟蹤autotraceSQL
- 使用SQL*PlusSQL
- Sqlplus下的set命令詳解SQL
- sqlplus 環境下部分set 命令SQL
- PLSQL Developer_v7_sqlplus:set head off and set head onSQLDeveloper
- 在SQLPLUS中使用AUTOTRACE——效能調整手冊和參考SQL