I am studying Oracle database. I have a question. That is tracing SQL on other sessions.
Here is my work:
SYS>
-- Get sid and serial of session which I'm gonna analyze
select sid, serial# from v$session where username = 'DEV';
-- Activate SQL Trace on the session(sid:69 / serial:72)
begin
dbms_monitor.session_trace_enable(69, 72);
end;
/
-- Check sql_trace is set 'ENABLED'
select sql_trace from v$session where username = 'DEV';
DEV>
-- SQL to be traced
select 'a' from dual connect by level <= 10;
SYS>
-- Deactivate SQL Trace
begin
dbms_monitor.session_trace_disable(69, 72);
end;
/
-- .trc file location check
select p.tracefile from v$process p, v$session s where p.addr = s.paddr and s.sid = userenv('sid');
And after that work, I tried to find the *.trc filie, but it doesn't exist. Whereas, when I try to trace the session which calls SQL Trace itself, I can find trc file(works fine).
What could be the reason not to be able to trace on other sessions?
Thanks