Friday, September 21, 2012

V$LICENSE

This was tested on Oracle 11.2. You can see the number of users currently logged in to a database as follows:

SQL> select count(*) from v$session
  2  where username is not null;

  COUNT(*)
----------
       415

SQL>

Here is another way to get the same information:

SQL> select sessions_current from v$license;

SESSIONS_CURRENT
----------------
             415

SQL>

The next statement shows the maximum number of concurrent users a database has had since it was opened:

SQL> select sessions_highwater from v$license;

SESSIONS_HIGHWATER
------------------
               422

SQL>

No comments:

Post a Comment