How to check number of sessions of a user in Oracle

To calculate number of session per username with status and detail source address, original OS user in Oracle database, you can use this command.

SELECT USERNAME, STATUS, OSUSER|| '@' || MACHINE AS SOURCEINFO, COUNT(*) AS NUMOFCONN 
 FROM v$session 
 WHERE TYPE = 'USER'
 GROUP BY USERNAME, STATUS, OSUSER|| '@' || MACHINE
 ORDER BY NUMOFCONN DESC;

The result of this command looks like this:

Number of session per username with status and detail source address, original OS user in Oracle database

A simplified version of above SQL command is:

SELECT USERNAME, STATUS, COUNT(*) AS NUMOFCONN FROM v$session GROUP BY USERNAME, STATUS ORDER BY NUMOFCONN DESC;

The result of this command looks like this:

oracle-number-of-session-per-user-with-status
oracle-number-of-session-per-user-with-status

So, depends on your need, select appropriate SQL. Good luck.

Related:  Formatting an individual column in Access “Table/Query” listbox