Event 10046 - Enable SQL Statement Trace
This event can be used to dump SQL statements executed by a session with execution plans and statistics. Bind variable and wait statistics can optionally be included. Level 12 is the most detailed.
For example
1.使用觸發器
create or replace trigger logon_trigger
after logon on database
begin
if (user='PAUL') then
execute immediate
'alter session set events ''10046 trace name context forever,level 12''';
end if;
end;
2.直接在sqlplus下使用命令
ALTER SESSION SET EVENTS '10046 trace name context forever, level 12';
關閉10046事件用以下命令:
alter session set events’10046 trace name context off’;
Level Action
1 Print SQL statements, execution plans and execution statistics
4 As level 1 plus bind variables
8 As level 1 plus wait statistics
12 As level 1 plus bind variables and wait statistics
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-120040/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- EVENT: 10046 "enable SQL statement tracing (including binds/waits)"SQLAI
- Oracle 10046 SQL TRACEOracleSQL
- sql_trace/ 10046 整理SQL
- sql_trace and 10046事件SQL事件
- Oracle SQL Trace 和 10046 事件OracleSQL事件
- 讀懂Oracle 10046 SQL TRACEOracleSQL
- Oracle SQL Trace 和10046 事件OracleSQL事件
- 跟蹤SQL - SQL Trace 及 10046 事件SQL事件
- How to Run Statement Level/Java trace or a SQL Trace in Self Service ApplicationJavaSQLAPP
- oracle sql trace與10046淺談OracleSQL
- Maclean教你讀Oracle 10046 SQL TRACEMacOracleSQL
- 使用10046 event trace跟蹤全表掃描操作
- How to enable trace in OracleOracle
- oracle sql跟蹤 event 10046 - 轉OracleSQL
- 單個SQL語句的10046 traceSQL
- sql_trace、10046、10053、tkprofSQL
- 如何使用SQL_TRACE和10046事件SQL事件
- Oracle中開啟trace 10046 event 的各種方法[zt]Oracle
- 利用10046事件收集SQL的trace檔案事件SQL
- Oracle 11g新SQL Trace 10046方法OracleSQL
- SQL TRACE和TKPROF,10046的使用步驟SQL
- ORACLE TRACE 10046Oracle
- 10046 trace詳解(1)
- 使用 oracle 10046 eventOracle
- 使用SQL_TRACE /10046進行資料庫診斷SQL資料庫
- 設定 oracle event traceOracle
- 拜年+散分貼《Oracle SQL_TRACE和10046事件優化SQL例項》OracleSQL事件優化
- 只對某個特定的SQL語句開啟10046 traceSQL
- 如何收集用來診斷效能問題的10046 Trace(SQL_TRACE) (文件 ID 1523462.1)SQL
- ZT 自動10046 trace指令碼指令碼
- How to read Oracle 10046 trace fileOracle
- oracle Database Event trace 設定OracleDatabase
- event 10046等的設定
- oracle event 10046 level_事件Oracle事件
- SQL TraceSQL
- Oracle 10046 event詳解-轉載Oracle
- [oradebug命令學習3]How to Enable SQL_TRACE for Another Session Using OradebugSQLSession
- Statement (操作 SQL 語句)SQL