Below script will gives the information of
To run this query you need SELECT_CATALOG_ROLE or SELECT ANY DICTIONARY grant.
- Which user currently logged on
- Which sql query they are running
- Which computer the user is logged on
- How long the query is running
To run this query you need SELECT_CATALOG_ROLE or SELECT ANY DICTIONARY grant.
SELECT SUBSTR(SS.USERNAME,1,8) USERNAME, SS.OSUSER "USER", AR.MODULE || ' @ ' || SS.machine CLIENT, SS.PROCESS PID, TO_CHAR(AR.LAST_LOAD_TIME, 'DD-Mon HH24:MM:SS') LOAD_TIME, AR.DISK_READS DISK_READS, AR.BUFFER_GETS BUFFER_GETS, SUBSTR(SS.LOCKWAIT,1,10) LOCKWAIT, W.EVENT EVENT, SS.status, AR.SQL_fullTEXT SQL FROM V$SESSION_WAIT W, V$SQLAREA AR, V$SESSION SS, v$timer T WHERE SS.SQL_ADDRESS = AR.ADDRESS AND SS.SQL_HASH_VALUE = AR.HASH_VALUE AND SS.SID = w.SID (+) AND ss.STATUS = 'ACTIVE' AND W.EVENT != 'client message' ORDER BY SS.LOCKWAIT ASC, SS.USERNAME, AR.DISK_READS DESC ;
No comments:
Post a Comment