DOYENSYS Knowledge Portal




We Welcome you to visit our DOYENSYS KNOWLEDGE PORTAL : Doyensys Knowledge Portal




Thursday, June 30, 2016

Logged on Users

SET linesize 200 PAGESIZE 1000 FEED OFF;
COLUMN "sid,serial#" FORMAT A12
COLUMN "pid" FORMAT 999
COLUMN "status" FORMAT A8
COLUMN "schema" FORMAT A10
COLUMN "osuser" FORMAT A10
COLUMN "box" FORMAT A16
COLUMN "prg" FORMAT A30
--
SELECT
       ''''
    || s.sid
    || ','
    || s.serial#
    || ''';'                        "sid,serial#"
     , p.spid                        "pid"
     , s.status                      "status"
     , s.schemaname                  "schema"
     , s.osuser                      "osuser"
     , s.machine                     "box"
     , s.program                     "prg"
     , TO_CHAR(s.logon_time, 'DD.MM.YYYY HH24:MI') "logon_time"
  FROM
       v$session s,
       v$process p
WHERE s.paddr  = p.addr
ORDER BY s.username
/

No comments: