Users: View Currently Connected Users

Description: View all of the currently connected users on the system. Handy for spot security checks.

SELECT SUBSTR(v_$session.USERNAME,1,15) USERNAME,
SUBSTR(X.status,1,8) STATUS,
SUBSTR(X.server,1,10) SERVER,
SUBSTR(X.TYPE,1,10) TYPE,
SUBSTR(X.event,1,20) "WAIT EVENT",
DECODE(X.command,
       1,'Create Table',
       2,'Insert',
       3,'Select',
       6,'Update',
       7,'Delete',
       8,'Drop',
       9,'Create Index',
      10,'Drop Index',
      12,'Drop Table',
      17,'Grant',
      26,'Lock Table',
      42,'Alter Session',
      43,'Alter User',
      44,'Commit',
      45,'Rollback',
      X.command) COMMAND
FROM v_$session X, v_$session_wait Z
WHERE (X.sid = Z.sid)
AND X.username != 'SYS'
ORDER BY X.username;

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.