Re: Changing ROWID

From: Jonathan Lewis <Jonathan_at_jlcomp.demon.co.uk>
Date: Fri, 6 Jan 1995 20:06:47 +0000
Message-ID: <789422807snz_at_jlcomp.demon.co.uk>


In article <3efi14$b7c_at_newsbf02.news.aol.com>

           davidjroth_at_aol.com "DavidJRoth" writes:

: >Subject: Changing ROWID
: >From: danielkm_at_aol.com (Daniel K M)
: >Date: 4 Jan 1995 15:04:13 -0500
: >Message-ID: <3eeuvt$8cg_at_newsbf02.news.aol.com>
 

: >We recently had a small controversy around the office about when a ROWID
: >will change for a given row.

(cut)
:
: ROWID presists for the life of the row (insert --> delete).
:
: BUT - ROWID's all change if you do an export/import.
:
: In general it is not good practice to depend upon ROWID's staying the same
: since these are internal structures and Oracle could choose to change to
: way they work at any time.
:

I agree with the cautious approach approach, but it is interesting to note that Oracle depends upon storing rowids of one table in another table to make snapshots work !!!

BTW: now that Oracle 7 differentiates between chaining (rows smeared across blocks) and migrating (rowid in one block, row in another) it seems much more likely that rowids NEVER change.

Experiment:
Put a row into a cluster, check it rowid. Change its cluster key so that the row HAS to be moved to another block (define your cluster to make this happen).

The rowid does NOT change. If you do a block dump, the row is in the new block, with a 'head row id' of the old block, and the row entry for the old rowid consists of nothing but a pointer (actually the new row directory entry) of the moved row.

I don't think there could be a more convincing piece of circumstantial evidence to the theory that rowids don't change.

-- 
Jonathan Lewis
Received on Fri Jan 06 1995 - 21:06:47 CET

Original text of this message