Restricted Rowids

tsinglee發表於2007-11-22

Restricted rowids use a binary representation of the physical address for each row selected. When
queried using SQL*Plus, the binary representation is converted to a VARCHAR2/hexadecimal
representation. The following query:

SELECT ROWID, last_name FROM employees
WHERE department_id = 30;

can return the following row information:

ROWID ENAME
------------------ ----------
00000DD5.0000.0001 KRISHNAN
00000DD5.0001.0001 ARBUCKLE
00000DD5.0002.0001 NGUYEN


As shown, a restricted rowid's VARCHAR2/hexadecimal representation is in a three-piece format,
block.row.file:

The data block that contains the row (block DD5 in the example). Block numbers are relative to their
datafile, not tablespace. Therefore, two rows with identical block numbers could reside in two
different datafiles of the same tablespace.
The row in the block that contains the row (rows 0, 1, 2 in the example). Row numbers of a given
block always start with 0.
The datafile that contains the row (file 1 in the example). The first datafile of every database is
always 1, and file numbers are unique within a database.

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10599713/viewspace-983298/,如需轉載,請註明出處,否則將追究法律責任。

相關文章