List sessions / active connections in Oracle database

Oracle view v$session contains a lot of useful information about database sessions.

Before you begin

Please note that you need dba privilege to access the data in v$session view.

Query

select sid,
      serial#,
      osuser,
      machine,
      program,
      module
from v$session

Columns

  • sid - session identifier
  • serial# - session serial number
  • osuser - operating system client user name
  • machine - operating system machine name
  • program - operating system program name
  • module - name of the currently executing module as set by calling the DBMS_APPLICATION_INFO.SET_MODULE procedure

Sample results

You can see session list on our test server. My session sid=58, machine=ls-michalwrobel

sample results

0
There are no comments. Click here to write the first comment.