On the move:

I'm currently moving the following to their own blogs: Unix, HTML for Blogs, Perl & Java.
The links are on the left side.

Tuesday, September 16, 2008

Who's Running What?

Ttitle Left "Who's Running What" Skip 2
Set Linesize 200 Pagesize 200

Column Sid Format 999
Column Serial# Format 99999 Heading Serial|#
Column Audsid Format 99999 Heading Aud|Sid
Column Username Format A10 Heading Db|User
Column Osuser Format A20 Heading Os|User
Column Machine Format A20 Heading Machine
Column Terminal Format A12 Heading Terminal
Column Process Format A10 Heading Client|Process|Id
Column Spid Format A10 Heading Client|Server|Id
Column Program Format A20 Heading Client|Program|Name

Select s.Sid,s.Serial#,s.Audsid,
s.Username, s.Osuser,
s.Machine, s.Terminal,
p.Spid ,
From v$Process P,v$Session S
Where p.Addr = s.Paddr
And s.Audsid = Userenv('SESSIONID');
Thanks to Rob Balter of MSA, Pittsburgh, PA for the basics of this query.

No comments:

Post a Comment