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

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.
DBA Tips Data Pump Reference

0 comments:

Post a Comment

 

dba topics. Copyright 2011-16 All Rights Reserved | Site Map | Contact | Disclaimer | Google