Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: What's my session's pid?

Re: What's my session's pid?

From: Syltrem <syltremzulu_at_videotron.ca>
Date: Wed, 17 Aug 2005 10:28:36 -0400
Message-ID: <11g6id6ji4e3f3@corp.supernews.com>


select sid from v$mystat where rownum=1; is shorter...

-- 
Syltrem

http://pages.infinit.net/syltrem (OpenVMS related web site, en français)
"NetComrade" <netcomradeNSPAM_at_bookexchange.net> a écrit dans le message de
news:43020723.79247625_at_localhost...

> 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 Wed Aug 17 2005 - 09:28:36 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US