Skip to content

Instantly share code, notes, and snippets.

@RichVRed
Forked from ryanthames/current_logins.sql
Created April 28, 2017 23:56
Show Gist options
  • Save RichVRed/68b53d242bf203b01b2ac7807839a790 to your computer and use it in GitHub Desktop.
Save RichVRed/68b53d242bf203b01b2ac7807839a790 to your computer and use it in GitHub Desktop.
select username, osuser, program, module,
machine, terminal, process,
to_char(logon_time, 'YYYY-MM-DD HH24:MI:SS') as logon_time,
status,
case status
when 'ACTIVE' then null
else last_call_et
end as idle_time
from v$session
where type = 'USER';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment