Home > DBA Scripts, Oracle, Oracle 10g, Oracle 9i, Performance, SQL, SQL Tuning, System Queries > Oracle – Check Users Connected to Database

Oracle – Check Users Connected to Database

To find how many users are on the database issue the following:

SQL> SELECT username
FROM v$session;

Show what users are running

SQL> SELECT a.sid
, a.serial#
, a.username
, b.sql_text
FROM v$session a
, v$sqlarea b
WHERE a.sql_address=b.address;

You can add the following to the script if you have a lot of users and want to find one specific users code, but you will need to remove a.username from the above script:

AND a.username = '<username>';

  1. Anonymous
    September 19, 2017 at 5:17 PM

    I am issuing like this

    select username from v$session. it is showing some usernames are null what is the meaning of it

    • April 9, 2019 at 2:06 PM

      If you were to look in OEM you would see that those are sys$background sessions, things like QMON, EMON etc

  1. No trackbacks yet.

Leave a comment