How to Check the Number of Concurrent Users in the Oracle Database Dynamically?

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
There are two ways or two dynamic views to check this -v$license and v$session

The sessions_current column from the v$license gives the current count of the users in the database. This count will not have the oracle by default connection whereas it has only the application user connections are on live as of now.

V$LICENSE

Column
Description
SESSIONS_MAX
Maximum number of concurrent user sessions allowed for the instance
SESSIONS_CURRENT
Current number of concurrent user sessions
SESSIONS_HIGHWATER
Highest number of concurrent user sessions since the instance started

 Second way is you can count the number of rows in the v$session dynamic view. But this will include the connections of oracle background processes etc.

SQL> select sessions_current from v$license;

SESSIONS_CURRENT
----------------
             132

SQL>select osuser ,count(*) from v$session group by osuser;

OSUSER                           COUNT(*)
------------------------------ ----------
tomcat                                124
scott                                   1

oracle                                 39 ## The Oracle background process connections will be included in this.

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer