User Tools

Site Tools


dba:oracle:howtos:howto_trace_sql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
dba:oracle:howto_trace_sql [2022/02/11 11:12] – ↷ Page moved from oracle:howto_trace_sql to dba:oracle:howto_trace_sql dodgerdba:oracle:howtos:howto_trace_sql [2023/01/31 08:26] – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-====== [HOWTO] Trace any sql ====== 
- 
-====== Original documentation ====== 
-[[https://smarttechways.com/2018/12/10/trace-the-sql-query-with-sql-id-in-oracle/|Trace the SQL Query with SQL ID in Oracle]] 
- 
-====== Instructions ====== 
- 
-Identify your SQL ID of SQL Query which need to trace. 
-<code sql> 
-SELECT sql_id, plan_hash_value, substr(sql_text,1,40) sql_text 
-FROM v$sql 
-WHERE sql_text like 'SQL QUERY%'; 
-</code> 
- 
-Enable the trace of SQL with using ''<SQLID>'' in following statements: 
-<code sql> 
-alter system set events 'sql_trace [sql:<SQLID>] wait=true,bind=true'; 
-alter system set events 'trace[sql_optimizer.*] [sql:<SQLID>]'; 
-</code> 
- 
- 
- 
- 
-\\ 
-Disable tracing: 
-<code sql> 
-alter system set events 'sql_trace off'; 
-alter system set events 'trace[sql_optimizer.*] off'; 
-</code> 
  
dba/oracle/howtos/howto_trace_sql.txt · Last modified: 2023/01/31 08:26 by dodger