Document TypeㅣTechnical Information
FieldㅣManagement/Configuration
Document NumberㅣTADTI067
Overview
This explains how to check the Block Number of data using the Rowid value. This method can be verified through the DBMS_ROWID package.
Method
Using the DBMS_ROWID Package
To find the Blocknumber from a Rowid, the DBMS_ROWID package is used.
- dbms_rowid.rowid_absolute_fno function returns the file number from the given rowid.
- dbms_rowid.rowid_block_number function returns the block number within the file from the given rowid.
- dbms_rowid.rowid_row_number function returns the row number within the block from the given rowid.
Example Usage
Below is a simple example showing how to query the file number, block number, and row number from a rowid.
drop table test; create table test(n number); insert into test values (1); commit; select rowid, dbms_rowid.rowid_absolute_fno(rowid) "fno", dbms_rowid.rowid_block_number(rowid) "bno", dbms_rowid.rowid_row_number(rowid) "rno" from test;
Sample Execution Result
SQL> select rowid, 2 dbms_rowid.rowid_absolute_fno(rowid) "fno", 3 dbms_rowid.rowid_block_number(rowid) "bno", 4 dbms_rowid.rowid_row_number(rowid) "rno" 5 from test; ROWID fno bno rno ------------------ ------- ------- ------- AAAAadAACAAAABAAAA 2 64 0 1 row selected.