List Database Sessions
--
-- Show information on all database sessions
--
 
SET PAUSE ON
SET PAUSE 'Press Return To Continue'
SET HEADING ON
SET LINESIZE 300
SET PAGESIZE 60
COLUMN username FORMAT A21
COLUMN osuser FORMAT A8
COLUMN sid FORMAT 9,999,999
COLUMN serial# FORMAT 9,999,999
COLUMN lockwait FORMAT A6
COLUMN status FORMAT A8
COLUMN module FORMAT A20
COLUMN machine FORMAT A24
COLUMN program FORMAT A20
COLUMN logon_time FORMAT A20
 
SELECT LPAD(' ', (level-1)*2, ' ') || NVL(s.username, '(oracle)') AS username,
s.osuser,
s.sid,
s.serial#,
s.lockwait,
s.status,
s.module,
s.machine,
s.program,
TO_CHAR(s.logon_Time,'DD-MON-YYYY HH24:MI:SS') AS logon_time
FROM   v$session s
CONNECT BY PRIOR s.sid = s.blocking_session
START WITH s.blocking_session IS NULL
/

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License