Re: Who is locking the row I want?
From: Doug Bitting <dbitting_at_us.oracle.com>
Date: Tue, 3 May 1994 14:40:00 GMT
Message-ID: <m0pyLdg-000AVQC_at_squid.us.oracle.com>
Date: Tue, 3 May 1994 14:40:00 GMT
Message-ID: <m0pyLdg-000AVQC_at_squid.us.oracle.com>
>>>>> On Tue, 3 May 94 09:11:58 +0100, jna_at_astrakan.se (Johan Andersson)
>>>>> said:
Johan> How do I identify the session that holds a lock on a specific Johan> row in a table? Is it possible in Oracle7?
Connecting to an Oracle 7.0.15 database, I can do the following:
- snip here ---
SQLDBA> insert into scott.footest values (1);
1 row processed.
SQLDBA> select osuser from v$session
2> where sid in
3> (select sid from v$lock
4> where id1 = (select object_id from dba_objects
5> where object_name = 'FOOTEST'
6> and owner = 'SCOTT'));
OSUSER
dbitting 1 row selected. - snip here ---
In this particular example, I use "in" on line 2> because it's possible that more than one person could have a lock on the table footest.
Hope this helps.
--Doug
-- Doug Bitting || Oracle Corporation || dbitting_at_oracle.com Worldwide Technical Support || Apple Desktop Products Group All opinions expressed in this article are my own and may not reflect those of Oracle Corporation.Received on Tue May 03 1994 - 16:40:00 CEST