Session-Level SQL Tracing
Published by : Obay Salah , November 19, 2024
Tracing can be enabled at the Session level.
alter session set sql_trace=true;
After configuring the Session, a Trace File is generated in the User_Dump_Dest path, where the Trace File is named with the (process ID number of the server process).
Now, a Trace File is created when a SQL Statement is executed, and the file is stored in the User_Dump_Dest path.
The database administrator can also enable Tracing for a specific User Session through the procedure Session_Trace_Enable available in the DBMS_MONITOR package, after identifying the Session using the (Session Identifier & Serial Number).
Let's assume now we want to put the Session for the user OBAY in Tracing mode.
Select Sid, serial# from v$session where username='OBAY';
Now, using this Session information, we can enable it in Tracing mode.
begin dbms_monitor.session_trace_enable( session_id=>841, serial_num=>27); end; /
You can also disable this mode through the procedure Session_Trace_Disable.
Comments
no comment yet!