Thursday, June 1, 2017

Session Details Queries

Session Details Queries

### session by cpu-usage:


SELECT ss.username, se.SID, VALUE / 100 cpu_usage_seconds
FROM v$session ss, v$sesstat se, v$statname sn
WHERE     se.STATISTIC# = sn.STATISTIC#
     AND NAME LIKE '%CPU used by this session%'
     AND se.SID = ss.SID
     AND ss.status = 'ACTIVE'
     AND ss.username IS NOT NULL
ORDER BY VALUE DESC;

### session sorted by logon time:

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;



No comments:

Post a Comment