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: Obtain the ROWID from a index block

Re: Obtain the ROWID from a index block

From: Andy Hassall <andy_at_andyh.co.uk>
Date: Wed, 02 Mar 2005 22:56:24 +0000
Message-ID: <4pgc21l3fgrash3m3a6dh22hr85irgeu0u@4ax.com>


On 1 Mar 2005 07:53:03 -0800, bobde6_at_hotmail.com wrote:

>How can I find the rowid value from an index block dump
>
>row#0[8018] flag: -----, lock: 0
>col 0; len 4; (4): c3 07 39 39
>col 1; len 6; (6): 08 80 4d 19 00 00
>----- end of leaf block dump -----
>End dump data blocks tsn: 4 file#: 34 minblk 45453 maxblk 45453
>
>I would like to convert this '08 80 4d 19 00 00' into a ROWID value

 That must be a non-unique index if it's got the rowid on the end; for a unique index you get the rowid in the row# line:

row#0[8021] flag: ------, lock: 2, len=11, data:(6): 01 01 9e a2 00 00 col 0; len 2; (2): c1 02
----- end of leaf block dump -----

 Six bytes is too short for a ROWID, but the start of a ROWID is the data object number. Since this'll be the same for all the index entries, i.e. the table that the index is on, it looks like it's omitted here.

 Dumping the ROWID of the single row from the table that the index that my block dump above is in seems to back this up:

SQL> select dump(rowid,16) from t;

DUMP(ROWID,16)



Typ=69 Len=10: 0,0,b0,45,1,1,9e,a2,0,0

 The trailing bytes (0x01019ea20000) match that from the block dump.  The leading bytes (0x0000b045) are 45125 in decimal, and:

SQL> select object_id from user_objects where object_name = 'T';

 OBJECT_ID


     45125

-- 
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Received on Wed Mar 02 2005 - 16:56:24 CST

Original text of this message

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