关于RowId RowNum uRowId的区别

About ROWID, UROWID, ROWNUM

 

ROWID:Before the release of Oracle8, ROWID datatype was used to store the physical       address of each row of each table, as a hexadecimal number.
UROWID:With Oracle8, the logical ROWID was introduced. To support both logical and       physical ROWIDs (as well as ROWIDs of non-Oracle tables) the Universal ROWID was defined. You can use character host variables to store rowids in a readable format. When you SELECT or FETCH a rowid into a character host variable, Oracle converts the binary value to an 18-byte character string and returns it in the format BBBBBBBB.RRRR.FFFF where BBBBBBBB is the block in the database file, RRRR is the row in the block (the first row is 0), and FFFF is the database file. These numbers are hexadecimal. For example, the rowid 0000000E.000A.0007 points to the 11th row in the 15th block in the 7th database file.
ROWNUM:ROWNUM returns a number indicating the order in which a row was selected from a table. The first row selected has a ROWNUM of 1, the second row has a ROWNUM of 2, and so on. If a SELECT statement includes an ORDER BY clause, ROWNUMs are assigned to the retrieved rows before the sort is done.
Oracle8以上版本的ROWID组成OOOOOOFFFBBBBBBRRR 8以下ROWID组成(也叫受限Rowid)BBBBBBBB.RRRR.FFFF 其中,O是对象ID,F是文件ID,B是块ID,R是行ID 如果我们查询一个表的ROWID,根据其中块的信息,可以知道该表确切占用了多少个块,进而知道占用了多少数据空间(此数据空间不等于表的分配空间)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值