Saturday, January 22, 2011

Show all connected users

Show all connected users

set lines 100 pages 999
col ID format a15
select username
,      sid || ',' || serial# "ID"
,      status
,      last_call_et "Last Activity"
from   v$session
where  username is not null
order by status desc
,        last_call_et desc
/

Output:


USERNAME                       ID              STATUS   Last Activity
------------------------------ --------------- -------- -------------
WEBUSER                        116,18996       INACTIVE          1766
WEBUSER                        132,33364       INACTIVE          1727
WEBUSER                        127,4392        INACTIVE          1709
WEBUSER                        124,20787       INACTIVE          1682
SYS                            143,10          INACTIVE           436
ORA_BLA                        126,37072       INACTIVE             3
ORA_BLA                        115,6676        INACTIVE             3
ORA_BLA                        139,5349        INACTIVE             3
REP_USER                       141,3881        ACTIVE               0 
REP_USER                       144,17898       ACTIVE               0
REP_USER                       129,8407        ACTIVE               0
REP_USER                       145,19887       ACTIVE               0
SYS                            131,34710       ACTIVE               0

13 rows selected.

No comments:

Post a Comment