User Tools

Site Tools


dba:oracle:howto_trace_sql

[HOWTO] Trace any sql

Original documentation

Instructions

Identify your SQL ID of SQL Query which need to trace.

SELECT sql_id, plan_hash_value, substr(sql_text,1,40) sql_text
FROM v$sql
WHERE sql_text LIKE 'SQL QUERY%';

Enable the trace of SQL with using <SQLID> in following statements:

ALTER system SET events 'sql_trace [sql:<SQLID>] wait=true,bind=true';
ALTER system SET events 'trace[sql_optimizer.*] [sql:<SQLID>]';


Disable tracing:

ALTER system SET events 'sql_trace off';
ALTER system SET events 'trace[sql_optimizer.*] off';
dba/oracle/howto_trace_sql.txt · Last modified: 2022/02/11 11:36 by 127.0.0.1