Path: text.usenetserver.com!out03a.usenetserver.com!news.usenetserver.com!in02.usenetserver.com!news.usenetserver.com!postnews.google.com!16g2000cwy.googlegroups.com!not-for-mail
From: "gazzag" <gareth@jamms.org>
Newsgroups: comp.databases.oracle.server
Subject: Re: current users enquiry
Date: 12 Dec 2006 04:36:01 -0800
Organization: http://groups.google.com
Lines: 25
Message-ID: <1165926961.463220.68970@16g2000cwy.googlegroups.com>
References: <1165916955.301010.285640@n67g2000cwd.googlegroups.com>
NNTP-Posting-Host: 193.130.12.157
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Trace: posting.google.com 1165926967 19218 127.0.0.1 (12 Dec 2006 12:36:07 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 12 Dec 2006 12:36:07 +0000 (UTC)
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: 16g2000cwy.googlegroups.com; posting-host=193.130.12.157;
   posting-account=zujbXgsAAAA8hne0tKRbNp7NAGtNgEwN
Xref: usenetserver.com comp.databases.oracle.server:418989
X-Received-Date: Tue, 12 Dec 2006 07:36:07 EST (text.usenetserver.com)

gd6502@eudoramail.com wrote:
> Hi everybody
> For my Oracle 9i db, I need to know how many users are accessing to a
> specific schema, and, if possible, which application are they using.
> Can I obtain this goal with the user id specified for the schema,
> without using administration tools (just a query)?
> Thanks a lot
>
> Peppe

Try the following query:

select username, osuser, lpad(sid,4)||', '||lpad(serial#, 6) Proc,
program, to_char(logon_time, 'DD-Mon-yy HH24:MI:SS') Logon
from v$session
where username is not null
order by username, osuser, Logon;

Note that this also returns the SID and SERIAL# of each session, should
you need to affect it.

HTH

-g

