who on earth is locking that row
From: Axel Rose;WMD GmbH <rose_at_wmdhh.wmd.de>
Date: Sun, 15 May 94 20:11:56 GMT
Message-ID: <1994May15.201156.27258_at_wmdhh.wmd.de>
Date: Sun, 15 May 94 20:11:56 GMT
Message-ID: <1994May15.201156.27258_at_wmdhh.wmd.de>
Hi Folks!
I was wondering whether I can find out which user is locking a certain row. Neither V$PROCESS nor V$LOCK nor any other system table could reveal this information if everything I know is the ROWID of the locked row.
What I need is a SQL statement looking like this:
SELECT USERNAME
FROM V$PROCESS, V$LOCK [, ???]
WHERE ROWID = <KNOWN TO ME>
AND ???
I know that this method is not bullet proof because the lock
could have gone during my investigations - but this does not matter.
P.S. There is a method to do the job if you have a trace file
which is automatically generated by a deadlock (published recently in this newsgroup). But my everyday situation is this: user A: select 0 from myTable where rowid=1 for update nowait; user B: select 0 from myTable where rowid=1 for update nowait; <the needed SQL statement> now you can tell user B to contact user A! -- Axel Rose - Hamburg, Germany "Ich bin der Geist, der stets verneint! e-mail: rose_at_wmdhh.wmd.de Und das mit Recht; denn alles, was entsteht, phone : +49-40-58958-236 Ist wert, dass es zugrunde geht; fax : +49-40-58958-199 Drum besser waer's, dass nichts entstuende."Received on Sun May 15 1994 - 22:11:56 CEST