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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 10046 SQL TRACEOracleSQL
- 單個SQL語句的10046 traceSQL
- ADFS – How to enable Trace Debugging and advanced access logging
- SQL TraceSQL
- 【TRACE】如果通過10046跟蹤資料庫效能問題資料庫
- 使用dbms_monitor.session_trace_enable跟蹤一個會話Session會話
- 從10046 trace 的trca報告中總結的時間模型示例模型
- sql_trace相關指令碼SQL指令碼
- Oracle診斷案例-Sql_traceOracleSQL
- [20220323]完善tpt get_trace.sql指令碼.txtSQL指令碼
- 10046事件概述事件
- Statement
- 10046 tracefile註釋
- 使用SQL_TRACE進行資料庫診斷(轉)SQL資料庫
- oracle ENABLE=BROKENOracle
- hibernate配置級聯刪除時報錯:could not execute statement; SQL [n/a]; constraint [null]SQLAINull
- enable_index_filterIndexFilter
- FSM:Enable shift register
- JS - if else and else if statementJS
- 從10046看Oracle分割槽裁剪Oracle
- GCC編譯遇到“a label can only be part of a statement and a declaration is not a statement”問題GC編譯
- Oracle session traceOracleSession
- Oracle執行語句跟蹤 使用sql trace實現語句追蹤OracleSQL
- MySQL:You must reset your password using ALTER USER statement before executing this statement.MySql
- 追溯 MySQL Statement Cancellation TimerMySql
- DBMS_TRACE(zt)
- event_x ()、event_y ()、event_x_root ()、event_y_root ()
- 用10046進行診斷一例
- Spring中Enable*功能的使用Spring
- statement 、prepareStatement的用法和解釋REST
- JDBC - Statement物件 - executeBatch()和executeUpdate()JDBC物件BAT
- PostgreSQL DBA(101) - pgAdmin(statement timeout)SQL
- JDBC入門(一):Statement物件JDBC物件
- JDBC3——SQL隱碼攻擊、及其解決方法——Statement與PreparedStatement對比——PreparedStatement的CRUDJDBCSQL
- Android Framework: 增加trace點AndroidFramework
- RuntimeWarning: Enable tracemalloc to get the object allocation tracebackObject
- SpringBoot開發自己的@Enable功能Spring Boot
- MySQL案例01:Last_SQL_Errno: 1755 Cannot execute the current event group in the parallel modeMySqlASTParallel
- Oracle vs PostgreSQL Develop(16) - Prepared StatementOracleSQLdev