How to list active / open connections in Oracle?
Is there any hidden table, system variable or something to show active connections in a given moment?
Solution 1:
Use the V$SESSION
view.
V$SESSION
displays session information for each current session.
Solution 2:
For a more complete answer see: http://dbaforums.org/oracle/index.php?showtopic=16834
select
substr(a.spid,1,9) pid,
substr(b.sid,1,5) sid,
substr(b.serial#,1,5) ser#,
substr(b.machine,1,6) box,
substr(b.username,1,10) username,
-- b.server,
substr(b.osuser,1,8) os_user,
substr(b.program,1,30) program
from v$session b, v$process a
where
b.paddr = a.addr
and type='USER'
order by spid;
Solution 3:
When I'd like to view incoming connections from our application servers to the database I use the following command:
SELECT username FROM v$session
WHERE username IS NOT NULL
ORDER BY username ASC;
Simple, but effective.