Saturday, January 22, 2011

Show user info including os pid

Show user info including os pid

col "SID/SERIAL" format a10
col username format a15
col osuser format a15
col program format a40
select s.sid || ',' || s.serial# "SID/SERIAL"
, s.username
, s.osuser
, p.spid "OS PID"
, s.program
from v$session s
, v$process p
Where s.paddr = p.addr
order  by to_number(p.spid)
/

Output:
SID/SERIAL USERNAME        OSUSER          OS PID       PROGRAM
---------- --------------- --------------- ------------ ---------------------------
141,3881   REP_USER        oracle          2608         httpd@bloo (TNS V1-V3)
144,17898  REP_USER        oracle          2897         httpd@bloo (TNS V1-V3)
115,6676   ORA_BLA                         3375
129,8407   REP_USER        oracle          7364         httpd@bloo (TNS V1-V3)
145,19887  REP_USER        oracle          8224         httpd@bloo (TNS V1-V3)
116,18996  WEBUSER         oracle          11872        httpd@bloo (TNS V1-V3)
132,33364  WEBUSER         oracle          11972        httpd@bloo (TNS V1-V3)
170,1                      oracle          12027        oracle@bloo (PMON)
158,8                      oracle          12102        oracle@bloo (q000)
146,1                      oracle          12104        oracle@bloo (q001)
127,4392   WEBUSER         oracle          12362        httpd@bloo (TNS V1-V3)
124,20787  WEBUSER         oracle          12375        httpd@bloo (TNS V1-V3)
131,34710  SYS             oracle          12835        sqlplus@bloo (TNS V1-V3)
143,10     SYS             oracle          13338        emagent@bloo (TNS V1-V3)
139,5349   ORA_BLA                         25799
126,37072  ORA_BLA                         25801

16 rows selected.

No comments:

Post a Comment