windows pid tracing to oracle pid



C:\> tasklist


tasklist /v


to know help

TASKLIST /?


TASKLIST /fi "ImageName eq sqlplusw.exe"


TASKLIST /fi "ImageName eq sqlplusw.exe"

netstat -aon | findstr <PID>


on the database server

netstat -p |grep


C:\Documents and Settings\itpc>TASKLIST /fi "ImageName eq frmweb.exe"

Image Name                   PID Session Name     Session#    Mem Usage
========================= ====== ================ ======== ============
frmweb.exe                1512 Console                 0     13,212 K

C:\Documents and Settings\itpc>

C:\Documents and Settings\itpc>netstat -aon |findstr 1512

  TCP    10.35.9.40:1407       10.35.9.65:1521         ESTABLISHED     1512

Here 1407 can be located in listener.log of 10.35.9.65

Also

on the database server

netstat -p |grep 1407

tcp        0      0 lab65:1521                  10.35.9.40:1407             ESTABLISHED 12448/oracleaplab65

Here PID on oracle database is 12448

From this we can find sid,serial#

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