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.
High Performance Database Engineering
Available for long and short term contracts
> 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