且构网

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

使用ROWID在Oracle中定位行/记录是否安全?

更新时间:2023-01-12 15:19:00

从Oracle 8开始,ROWID的格式和大小从8字节更改为10个字节.请注意,ROWID的格式将在您重新组织或导出/导入表.如果是分区表,则在UPDATE期间如果行从一个分区迁移到另一个分区,它也会更改."

"From Oracle 8 the ROWID format and size changed from 8 to 10 bytes. Note that ROWID's will change when you reorganize or export/import a table. In case of a partitioned table, it also changes if the row migrates from a partition to another one during an UPDATE."

http://www.orafaq.com/wiki/ROWID

我会拒绝.如果例如应用程序临时存储ROWID(例如,生成一个可选择项的列表,每个项用ROWID标识,但是该列表将定期重新生成而不存储),则这可能是安全的.但是,如果以任何持久方式使用ROWID,那都是不安全的.

I'd say no. This could be safe if for instance the application stores ROWID temporarily(say generating a list of select-able items, each identified with ROWID, but the list is routinely regenerated and not stored). But if ROWID is used in any persistent way it's not safe.