Saturday, January 22, 2011

Sessions sorted by logon time

Sessions sorted by logon time

set lines 100 pages 999
col ID  format a15
col osuser format a15
col login_time format a14
select  username
, osuser
, sid || ',' || serial# "ID"
, status
, to_char(logon_time, 'hh24:mi dd/mm/yy') login_time
, last_call_et
from v$session
where username is not null
order by login_time
/
Output:

USERNAME        OSUSER          ID         STATUS   LOGIN_TIME     LAST_CALL_ET
--------------- --------------- ---------- -------- -------------- ------------
ORA_BLA                         115,6676   INACTIVE 06:51 19/05/08          181
REP_USER        oracle          141,3881   ACTIVE   08:17 19/05/08            0 
REP_USER        oracle          144,17898  ACTIVE   08:18 19/05/08            0
REP_USER        oracle          129,8407   ACTIVE   08:23 19/05/08            0
REP_USER        oracle          145,19887  ACTIVE   08:28 19/05/08            0
ORA_BLA                         139,5349   INACTIVE 09:51 19/05/08          181
ORA_BLA                         126,37072  INACTIVE 09:51 19/05/08          181
WEBUSER         oracle          116,18996  INACTIVE 10:51 19/05/08         1944
WEBUSER         oracle          127,4392   INACTIVE 10:52 19/05/08         1887
WEBUSER         oracle          124,20787  INACTIVE 10:52 19/05/08         1860
WEBUSER         oracle          132,33364  INACTIVE 10:52 19/05/08         1905
SYS             oracle          131,34710  ACTIVE   10:56 19/05/08            0
SYS             oracle          143,10     INACTIVE 14:13 16/04/08          614

13 rows selected.

SQL>

No comments:

Post a Comment