Re: find what user has a row locked for update??

From: DA Morgan <damorgan_at_psoug.org>
Date: Fri, 20 May 2005 23:38:11 -0700
Message-ID: <1116657228.631304_at_yasure>


jeffchirco_at_gmail.com wrote:
> Is there a way to find out what user has a lock on a record? I am
> performing a lock on a record by doing a for update nowait in my select
> statement. I want to get down to the row that is locked in that table.
> I have found that I can see what user has a record locked on a table
> by executing:
> select
> oracle_username,
> os_user_name,
> locked_mode,
> object_name,
> object_type
> from
> v$locked_object a,dba_objects b
> where
> a.object_id = b.object_id;
>
> Is there a way to find out which record that user is locking? Say an
> ID field.
> Thanks.
>
> Jeff Chirco

This may not be what you want but look at:

$ORACLE_HOME/rdbms/admin/catblock.sql
Creates views that dynamically display lock dependency graphs

$ORACLE_HOME/rdbms/admin/userlock.sql
Routines that allow the user to request, convert and release locks.

$ORACLE_HOME/rdbms/admin/utllockt.sql
Prints the sessions in the system that are waiting for locks, and the locks they are waiting for.

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Sat May 21 2005 - 08:38:11 CEST

Original text of this message