set pages 999 select s.sid, s.serial#, s.osuser, s.program, s.status, decode(s.command, 1,'Create table' , 2,'Insert', 3,'Select' , 6,'Update', 7,'Delete' , 9,'Create index', 10,'Drop index' ,11,'Alter index', 12,'Drop table' ,13,'Create seq', 14,'Alter sequence' ,15,'Alter table', 16,'Drop sequ.' ,17,'Grant', 19,'Create syn.' ,20,'Drop synonym', 21,'Create view' ,22,'Drop view',23,'Validate index' ,24,'Create procedure', 25,'Alter procedure' ,26,'Lock table', 42,'Alter session' ,44,'Commit', 45,'Rollback' ,46,'Savepoint', 47,'PL/SQL Exec' ,48,'Set Transaction', 60,'Alter trigger' ,62,'Analyze Table', 63,'Analyze index' ,71,'Create Snapshot Log', 72,'Alter Snapshot Log' ,73,'Drop Snapshot Log', 74,'Create Snapshot' ,75,'Alter Snapshot', 76,'drop Snapshot' ,85,'Truncate table', 0,'No command', '? : '||s.command) nocommand from v$session s / -- kill the session alter system kill session 'sid,serial' -- source: http://www.shutdownabort.com/dbaqueries/Administration_Session.php -- last activity set lines 100 pages 999 select username , floor(last_call_et / 60) "Minutes" , status from v$session where username is not null order by last_call_et / -- last logon time set lines 100 pages 999 col ID format a15 col osuser format a15 col login_time format a14 select username , osuser , sid || ',' || serial# "ID" , status , to_char(logon_time, 'hh24:mi dd/mm/yy') login_time , last_call_et from v$session where username is not null order by login_time / -- open cursors set pages 999 select sess.username , sess.sid , sess.serial# , stat.value cursors from v$sesstat stat , v$statname sn , v$session sess where sess.username is not null and sess.sid = stat.sid and stat.statistic# = sn.statistic# and sn.name = 'opened cursors current' order by value; -- or this one set lines 100 pages 999 select count(hash_value) cursors, sid, user_name from v$open_cursor group by sid,user_name order by cursors;