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: enqueue wait events, locks and the meaning of id1/id2

Re: enqueue wait events, locks and the meaning of id1/id2

From: Brian Peasland <dba_at_remove_spam.peasland.com>
Date: Wed, 28 Jan 2004 15:34:40 GMT
Message-ID: <4017D690.EE03AA8E@remove_spam.peasland.com>

> I modified the query a bit, to this:
> SELECT
> TRUNC(id1/POWER(2,16)) rbs,
> BITAND(id1,65535)+0 slot, id2 seq
> FROM v$lock
> WHERE type='TX'
> AND lmode = 6
>
> This gives me the following output:
> RBS SLOT SEQ
> ---------- ---------- ----------
> 6 80 1195257
> 6 70 1192089
> 6 42 1193083
> 5 72 1060150
> 5 96 1055042
> 6 16 1190901
> 5 14 1056651
> 5 9 1058258
> 6 1 1196554
> 5 51 1057005
> 5 1 1056275
>
> RBS SLOT SEQ
> ---------- ---------- ----------
> 6 9 1189959

You might also want to include the SID in your query of V$LOCK so you know which session these belong to. Also, the LMODE and REQUEST columns are useful. If LMODE != 0, then a locked is obtained. If REQUEST!=0, then the session is waiting on a lock.  

> Is it possible to join this info with e.g. v$transaction to find the object?

Not to find the object. But the RBS, SLOT, and SEQ columns above match the XIDUSN, XIDSLOT, and XIDSQN columns of V$TRANSACTION, respectively.

Alternatively, to find the object, query V$LOCKED_OBJECT. The RBS, SLOT, and SEQ columns above match the XIDUSN, XIDSLOT, and XIDSQN columns of V$LOCKED_OBJECT, respectively. From there, you should be able to get the OBJECT_ID, which maps to DBA_OBJECTS.

HTH,
Brian

-- 
===================================================================

Brian Peasland
dba_at_remove_spam.peasland.com

Remove the "remove_spam." from the email address to email me.


"I can give it to you cheap, quick, and good. Now pick two out of
 the three"
Received on Wed Jan 28 2004 - 09:34:40 CST

Original text of this message

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