[Oracle Script] check user
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
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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [Oracle Script] check object count by userOracleObject
- [Oracle Script] check latchOracle
- [Oracle Script] check active sessionOracleSession
- [Oracle Script] check lock infoOracle
- [Oracle Script] check Literal SQLOracleSQL
- [Oracle Script] check tablespace usage infoOracle
- [Oracle Script] check temp tablespace usageOracle
- [Oracle Script] check File I/OOracle
- check ftp success scriptFTP
- script of check repair ASM DISKGROUPAIASM
- RAC User Equivalence Check FailedUIAI
- PRVF-4007 : User equivalence check failed for user "grid"UIAI
- oracle scriptOracle
- [Oracle Script] LockOracle
- Oracle Database ScriptOracleDatabase
- oracle user$Oracle
- [Oracle Script] Top sqlOracleSQL
- Oracle kill session scriptOracleSession
- ORACLE常用Script(轉)Oracle
- ORACLE常用Script (轉)Oracle
- Script to Check for Foreign Key Locking Issues [ID 1019527.6]
- Check the transaction running in oracleOracle
- [Oracle Script] Log switch statusOracle
- [Oracle Script] latch holderOracle
- [Oracle Script] Temporary Sort UsageOracle
- [Oracle Script] Rollback Segment UsageOracle
- ORACLE WITH CHECK OPTION子句詳解Oracle
- Oracle OCP(28):USEROracle
- oracle user privsOracle
- 【oracle】user_tablesOracle
- Script to Show System and Object Privs for a User (Doc ID 1019508.6)Object
- [Oracle Script] select db parameterOracle
- [Oracle Script] ASM Disks Performance metricOracleASMORM
- [Oracle Script] Undo Usage Per statusOracle
- [Oracle Script] Undo Usage Per sessionOracleSession
- [Oracle Script] Buffer Cache Hit RatioOracle
- [Oracle] Device Checks for ASM - This is a pre-check........OracledevASM
- ORACLE USER 變數值Oracle變數