Created
November 24, 2018 21:21
-
-
Save mkurian/e1b567675d213d75ca389d98da0a1187 to your computer and use it in GitHub Desktop.
oracle: get sessions
This file contains 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
SET LINESIZE 100 | |
COLUMN spid FORMAT A10 | |
COLUMN username FORMAT A10 | |
COLUMN program FORMAT A45 | |
SELECT s.inst_id, | |
s.sid, | |
s.serial#, | |
--s.sql_id, | |
p.spid, | |
s.username, | |
s.program | |
FROM gv$session s | |
JOIN gv$process p ON p.addr = s.paddr AND p.inst_id = s.inst_id | |
WHERE s.type != 'BACKGROUND'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment