I have the following situation. I have two session 10, 40 having the same OS process ID (24905). Session 40 is holding lock on a resource and other sessions are waiting for it.

On tracing the session 40 (spid= 24905), I get the following lines.

WAIT #1: nam='enqueue' ela= 16 p1=1415053316 p2=196628 p3=1397
WAIT #1: nam='enqueue' ela= 307 p1=1415053316 p2=196628 p3=1397


select s.sid sid, p.spid from v$session s, v$process p where s.sid in (10,40) and s.paddr = p.addr ;

SID SPID
---- ------
10 24905
40 24905

select * from v$session ;

SADDR SID SERIAL# AUDSID PADDR COMMAND OWNERID TADDR LOCKWAIT STATUS SERVER PROCESS SQL_ADDR
-------- --- ------- ------ -------- ------- ---------- -------- -------- -------- --------- ------- --------
580A7DBC 10 13499 329589 5808C554 2 2147483644 586B9554 5812C3EC ACTIVE DEDICATED 8132 589186E8

580B753C 40 56156 329590 5808C554 0 2147483644 586BB82C INACTIVE DEDICATED 8132 58979DA8


On tracing the parent process (Apache, it seems it is waiting on Oracle). But Quesry on Oracle (V$session_wait) shows its waiting for the response from the client.

Now my main question is,

Can anyone tell me, when does more than one session (SIDs) have the same OS process id?

How to find who is actually waiting for who? (from the trace Oradebug and os
process trace it looks to me Oracle is waiting for the Apache/Client process
and Apache is waiting for the Oracle Process)

Any suggestion of you will be greatly appreciated.

Thanks,