This gives you a lot more than what you asked for but you can change it
to your needs.
select decode(sum(decode(s.serial#, l.serial#, 1, 0)), 0, 'No', 'Yes') "
",
s.sid "Sid",
s.status "Status",
s.logon_time "Logon",
s.username "Username",
RTRIM(s.osuser) "OS User",
b.spid "OS Process ID",
s.machine "Machine Name",
NVL(s.module, s.program) "Program",
s.action "Action",
c.sql_text "SQL text"
from v$session s,
v$session_longops l,
v$process b,
(select address, sql_text from v$sqltext where piece = 0) c
where (s.sid = l.sid(+))
and s.paddr = b.addr
and s.sql_address = c.address(+)
group by s.sid,
s.status,
s.logon_time,
s.username,
s.osuser,
s.machine,
NVL(s.module, s.program),
s.action,
b.spid,
b.pid,
c.sql_text
order by s.sid
-----Original Message-----
From: Rajesh kalaria
[mailto:oracledba-ezmlmshield-x684660.[Email address protected]
Sent: Wednesday, August 08, 2007 9:04 AM
To: LazyDBA Discussion
Subject: How to find out how many users are connected for oracle server
Hi
I have to find out that how many users are connected at present to
oracle server. I don't have any idea about how to get that information
from which table or view.
Rajesh
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
Oracle LazyDBA home page