[Oracle Script] check user

tolilong發表於2017-08-06
select u.username,u.account_status,u.created,u.expiry_date,u.default_tablespace,u.temporary_tablespace,
sum(decode(sid,null,0,1)) "current logon",sum(decode(status,null,0,'INACTIVE',0,1)) "current active",round(sum(sysdate-logon_time)*24*60*60 / sum(decode(sid,null,0,1)),0) "Avg logon time"
from gv$session s,dba_users u where s.user#(+)=u.user_id
group by u.username,u.account_status,u.created,u.expiry_date,u.default_tablespace,u.temporary_tablespace

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-2143138/,如需轉載,請註明出處,否則將追究法律責任。

相關文章