Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Who has my row locked?

Re: Who has my row locked?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Sun, 12 Jul 1998 17:11:33 GMT
Message-ID: <35a9ec60.969884@192.86.155.100>


A copy of this was sent to sfinney_at_idir.net (thomas judge & shannon finney) (if that email address didn't require changing) On Sun, 12 Jul 1998 03:00:14 GMT, you wrote:

>Is there any way to find out what session/user has the lock on the row that I
>want to lock for update (when getting, for example, a resource_lock exception)?
>Oracle 7.2, AIX 4.1.5 on RS/6000 SP2. We have queries that show all locks, and
>I can narrow it down to all locks on a table, but is there any way to get the
>one user who has the row that I want? Have talked to Oracle support on this,
>they deny that it is possible or knowledge of how it could be done. My thought
>is, if the server can figure this out (from the V$ tables, I suppose) I should
>be able to.
>
>Thanks,
>Thomas
>

The server doesn't figure this out from the V$ tables, it figures it out from the block itself that someone else has it locked. There are no 'table of all locks taken' in Oracle.

AFAIK, the only 100% way to figure out who has your row locked is to use many sessions. One session will have the lock, the other session tries to get the lock and the third session (using logic similar to that found in $ORACLE_HOME/rdbms/admin/utllockt.sql) can see blockers and waiters...  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Sun Jul 12 1998 - 12:11:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US