Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> What's my session's pid?
Is there are a more elegant way to know my pid?
I've modified T. Kyte's method of 'Alternative Solution to Provide Worry-Free Access [to sql trace output' from his Effective Oracle by Design book (pages 129-135), to allow in session viewing of the trace file, since his method required a logoff, which would populate a table with trace file name.
Basically I did the following.
I left the trace_files user alone.
grant select on v_$process to trace_files with grant option; grant select on v_$session to trace_files with grant option; grant select on v_$instance to trace_files with grant option;
create or replace view session_trace_file_name
as
select lower(d.instance_name) || '_ora_' || ltrim(to_char(a.spid)) ||
'.trc' filename
from v$process a, v$session b, v$instance d
where a.addr = b.paddr
and b.audsid = sys_context ('userenv','sessionid');
grant select on session_trace_file_name to public;
And it seems to work.. fine.
So.. any drawbacks, and/or better way to do this?
thanks.
.......
We use Oracle 8.1.7.4 and 9.2.0.6/7 on Solaris 2.7 and RH4
remove NSPAM to email
Received on Tue Aug 16 2005 - 10:55:53 CDT
![]() |
![]() |