Thursday, 8 February 2007

Oracle 10g SQL Script to list the connected users

OK, I know that EM can give you the same result in much prettier form, but let's keep that just in case.

SET LINESIZE 200
SET PAGESIZE 66

SELECT s.username, s.logon_time, s.machine, s.osuser, s.program
FROM v$session s, v$process p, sys.v_$sess_io si
WHERE s.paddr = p.addr(+) AND si.sid(+) = s.sid AND s.type='USER';

No comments :