Last active
January 7, 2019 22:44
-
-
Save kbaesler/a23c306622e6167f0300f75d406ac0ea to your computer and use it in GitHub Desktop.
HOW TO FIND STALE SESSIONS IN ORACLE 12C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- To get a list of logged-in users and the last time they issued a command, connect to the database as a DBA user | |
-- | |
select S.USERNAME, | |
S.MACHINE, | |
S.OSUSER, | |
S.PROGRAM, | |
S.SID, | |
S.SERIAL#, | |
P.SPID, | |
S.LAST_CALL_ET as LAST_TIME_ACTIVE | |
from V$SESSION S, | |
V$PROCESS P | |
where S.PADDR = P.ADDR | |
and S.USERNAME is not null | |
order by S.USERNAME, LAST_TIME_ACTIVE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment