The problem is what is meant by "active."  If you query for
v$session(status) = 'ACTIVE' you will only get the sessions that are
currently in the middle of having a statement processed.  I doubt that
is what he is looking for.  If Abul wants everyone who is connected
but hasn't been idle for an hour or more, I would use the last_call_et
column as a predicate instead.

select count (*) from v$session where type != 'BACKGROUND' and
last_call_et <= 60;

You might consider leaving out the SNP sessions too, since they don't
get marked as type = 'BACKGROUND';

Anyway, if you are using any kind of web server or middle tier, these
aren't real users anyway, but just sessions acting as a shared
resource by many users.

As for the number of allowed users per your license, I would read the
license.  It isn't in the database.

--
Jeremiah Wilton
http://www.speakeasy.net/~jwilton

On Fri, 8 Mar 2002, Joan Hsieh wrote:

> SELECT s.client_info client,s.username,s.osuser,s.PROGRAM,p.pid,p.spid,
> s.sid,s.serial#, to_char(S.LOGON_TIME,'MONDD HH24:MI') "LOGON TIME"
>  from v$session s, v$process p
> where s.status='ACTIVE' and s.type != 'BACKGROUND'
> and p.addr=s.paddr
> 
> Abul Fazal wrote:
> > 
> > I would like to know the Number of Active Users from a
> > Query inside the Database. Plus is it possible to know
> > the number of allowed licence for the Oracle

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Jeremiah Wilton
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to