Re: Q: How do I find the SQL-Statement that is causing a lock

From: Paul Baumgartel <paulb_at_pcnet.com>
Date: 1996/01/18
Message-ID: <4dk8q8$q81_at_pcnet2.pcnet.net>#1/1


mpammer_at_vlr.gv.at (Martin Pammer) wrote:

>Oracle 7.2.2.4 on AIX
 

>I would like to track down which SQL Statement is causing an entry in
>the V$LOCK Table.
 

>For example select * from v$lock; gives me following result
 

>ADDR KADDR SID TY ID1 ID2 LMODE REQUEST
 
>--------------------------------------------------------------------------------------------------------
 

>401CFF68 401CFF7C 7 TM 1239 0 3 0
 
>401E86B8 401E874C 7 TX 262209 71 6 0

>Is there a way for me to find out which SQL Statement caused these
>rows in v$lock to show up ?

Why don't you try running the Lock monitor in SQL*DBA or Server Manager? It lists session ID's and the locks they hold or are waiting for. The information displayed comes from v$lock but it easier to decipher.

If you insist on using v$lock, you will need to inspect v$session and v$process as well in order to determine which session holds the locks.


Paul Baumgartel, Principal Consultant              paulb_at_pcnet.com 
Adept Computer Associates, Inc.                                    
********************************************************************
Received on Thu Jan 18 1996 - 00:00:00 CET

Original text of this message