Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Number of users in Oracle?

Re: Number of users in Oracle?

From: Ing. Josef Steindl <steindl_at_pop.ping.at>
Date: 1996/11/10
Message-ID: <32865f42.21384115@news.ping.at>#1/1

On Fri, 08 Nov 1996 14:25:48 -0800, "David E. Daniel" <david.daniel_at_wmich.edu> wrote:

>I recently download this script. Quite possibly from one of the ORacle
>news groups, perhaps here. It is as follows:
>
>select count (*)
>from v$session
>where username is not null;
>
>This script was labeled as one that would tell me how many users I
>currently have at any given time. It appears that I am currently over
>my limit on users because the count returned is 23. This however is not
>the case. I currently have only 11 users logged on, no batch processes
>running. I have 12 total licenses and I really would like to manage
>within that range.
>
>What is v$session supposed to show me. Is it current count, a
>cumulative total, or what?
>
>Is there a better way to check the total number of users?
>
>-David E. Daniel
>Western Michigan University

Hi David!

V$SESSION returns the current sessions on your RDBMS; not the number of users!

For information: An user can have more than one session! (this depends on your application and on the setup of the RDBMS !)

You should use the following statement to get the current number of users on your database:

SELECT COUNT(DISTINCT username)
FROM v$session
WHERE username IS NOT NULL;

Good luck!

Joe Steindl, Purkersdorf / Wien, So, 10.11.96, 23:15 Received on Sun Nov 10 1996 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US