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
Tags:
Oracle