Thursday, April 4, 2013

Get the Active Database Sessions


SELECT s.audsid AUDSID,
       i.instance_name "Instance",
       s.machine "Machine",
       s.program "Program",
       s.module "Module",
       s.osuser "User",
       s.process "Process",
       s.status "Status",
       s.logon_time "Logon Time"
  FROM gv$session s, gv$instance i
 WHERE s.audsid > 0 AND s.inst_id = i.inst_id;