且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

什么可以导致Oracle ROWID更改?

更新时间:2023-01-12 15:27:47

正如你所说的,它发生在任何时候, as:




  • 导出/导入表格

  • ALTER TABLE XXXX MOVE

  • ALTER表XXXX收缩空间

  • 回流表XXXX

  • 分割分区

  • 更新值以便移动到新分区

  • 合并两个分区



在索引组织表中,那么对主键的更新也会给你一个不同的ROWID。


AFAIK ROWID in Oracle represents physical location of a record in appropriate datafile. In which cases ROWID of a record may change ?

The one known to me is UPDATE on partitioned table that "moves" the record to another partition.

Are there another cases ? Most of our DBs are Oracle 10.

As you have said, it occurs anytime the row is physically moved on disk, such as:

  • Export/import of the table
  • ALTER TABLE XXXX MOVE
  • ALTER TABLE XXXX SHRINK SPACE
  • FLASHBACK TABLE XXXX
  • Splitting a partition
  • Updating a value so that it moves to a new partition
  • Combining two partitions

If is in an index organized table, then an update to the primary key would give you a different ROWID as well.