REM
REM DBAToolZ NOTE:
REM This script was obtained from DBAToolZ.com
REM It's configured to work with SQL Directory (SQLDIR).
REM SQLDIR is a utility that allows easy organization and
REM execution of SQL*Plus scripts using user-friendly menu.
REM Visit DBAToolZ.com for more details and free SQL scripts.
REM
REM
REM File:
REM c_user_trace_all.sql
REM
REM USER TRACE
REM
REM Author:
REM Vitaliy Mogilevskiy (www.dbatoolz.com)
REM
REM Purpose:
REM
REM Enables SQL TRACING for all sessions for a given USERNAME
REM TIMED_STATISTICS should be set to TRUE
REM
REM
REM Usage:
REM c_user_trace_all.sql USERNAME_TO_TRACE
REM
REM Example:
REM c_user_trace_all.sql
REM
REM
REM History:
REM 08-01-1998 VMOGILEV Created
REM
REM
set serveroutput on
begin
for sess_rec in (select sid,serial#
from v$session
where username like upper('&user_name'))
loop
sys.dbms_system.set_sql_trace_in_session
(sess_rec.sid, sess_rec.serial#,TRUE);
end loop;
end;
/
set serveroutput off