How to Know the PID of a user in Oracle


COL     DATETIME     FORMAT A20
COL    USR         FORMAT A10

SELECT     A.USERNAME USR,
    A.STATUS,A.SID,
    A.SERIAL#,
    LTRIM(RTRIM(TO_CHAR(A.LOGON_TIME,'DD/MM/YYYY HH:MM:SS'))) DATETIME,
    B.SPID
FROM     V$SESSION A,V$PROCESS B
WHERE     A.USERNAME IS NOT NULL
AND     A.PADDR=B.ADDR
AND     (B.SPID=UPPER('&&PIDUSR')
or     a.username=upper('&&PIDUSR'))
/
UNDEFINE PIDUSR


Post a Comment

And that's all there is to it!

If anyone has any other questions or requests for future How To posts, you can either ask them in the comments or email me. Please don't feel shy at all!

I'm certainly not an expert, but I'll try my hardest to explain what I do know and research what I don't know.

Previous Post Next Post