Doc
Name: SESS.sql
Author: Mahnho Han
List of current active session status
#
TTITLE OFF
CLEAR COLUMN
SET PAGESIZE 60
SET LINESIZE 130
COLUMN SID FORMAT 9999
COLUMN USERNAME FORMAT A12
COLUMN COMMAND FORMAT A20
SELECT PROCESS PID,SE.SID,SERIAL#,STATUS,USERNAME,
DECODE(COMMAND, 0,' ', -- Normal
1,'CREATE TABLE', 2,'INSERT',
3,'SELECT',
5,'ALTER CLUSTER', 6,'UPDATE',
7,'DELETE',
9,'CREATE INDEX',
45,'ROLLBACK',
47,'PL/SQL EXECUTE',
COMMAND) COMMAND,
TERMINAL
FROM V$SESSION SE,V$SESS_IO IO
WHERE STATUS != 'INACTIVE'
AND USERNAME != ' '
AND SE.SID = IO.SID
ORDER BY STATUS;
|