Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Displaying connected users
SELECT USERNAME, OSUSER, PROCESS, PROGRAM
FROM V$SESSION VS, V$MYSTAT VM
WHERE VS.SID = VM.SID (+)
AND VM.SID IS NULL;
By using a NULL outer join you can filter out your current session data in
V$MYSTAT from V$SESSION..
You can also look up your SID in v$mystat and simply put 'AND SID != ...' instead of joining to V$MYSTAT within your query.
Good Luck!
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Chris Weiss mailto:chris_at_hpdbe.com www.hpdbe.com High Performance Database Engineering Available for long and short term contracts "Naru Mangalath" <nmangalath_at_hotmail.com> wrote in message news:ec12f506.0205082017.262e353_at_posting.google.com...Received on Thu May 09 2002 - 01:10:36 CDT
> Hi,
> I am using the following select to display connected users:
>
> select username,osuser,process, program from v_$session
> where username is not NULL
>
> This works fine except that it also displays this active sqlplus
> session. How can I display all the connected users except the session
> that displays it?
>
> Thanks in advance!
>
> Naru Mangalath