Wednesday, July 22, 2015

Finding Operating Process With Oracle Process across by Session ID.



========== Query =========

set line 200
col sid format 999999
col username format a20
col osuser format a15
col PROGRAM format a15
col terminal format a15
col module format a15

select p.spid os_process_id,
       s.sid session_id,
       s.serial#,
       s.username,
       s.status,
       s.last_call_et,
       p.program,
       p.terminal,
       logon_time,
       module,
       s.osuser
from v$session s, v$process p
where s.paddr= p.addr
and p.spid='&spid'
order by p.spid;

===============================

SQL> set line 200
col sid format 999999
col username format a20
col osuser format a15
col PROGRAM format a15
col terminal format a15
col module format a15
SQL> SQL> SQL> SQL> SQL> SQL> SQL>
SQL>
SQL>
SQL> select p.spid os_process_id,
  2         s.sid session_id,
  3         s.serial#,
  4         s.username,
  5         s.status,
  6         s.last_call_et,
  7         p.program,
  8         p.terminal,
  9         logon_time,
 10         module,
 11         s.osuser
 12  from v$session s, v$process p
 13  where s.paddr= p.addr
 14  and p.spid='&spid'
 15  order by p.spid;
Enter value for spid: 11403790
old  14: and p.spid='&spid'
new  14: and p.spid='11403790'

OS_PROCESS_ID            SESSION_ID    SERIAL# USERNAME             STATUS   LAST_CALL_ET PROGRAM         TERMINAL        LOGON_TIM MODULE          OSUSER
------------------------ ---------- ---------- -------------------- -------- ------------ --------------- --------------- --------- --------------- ---------------
11403790                       4574      28565 PRODUSR              ACTIVE             39 oracle@DBSRV1    UNKNOWN         22-JUL-15 JDBC Thin Client


SQL>

No comments:

Post a Comment