Describe ROWID In Oracle

Detail of Rowid in Oracle

Each row has its physical address.

  • Datafiles Number
  • Block Number
  • Location of the row within Block
  • Object Number
SQL>select rowid, emp_id from emp;

ROWID                                     EMP_ID
——————                           ———-
AAAEtQAAEAAAACDAAA 100
AAAEtQAAEAAAACDAAB 101

Check the following query for getting file_no , block_no, row_no

select emp_id
,dbms_rowid.rowid_to_absolute_fno(rowid,schema_name=>’SCOTT’,object_name=>’EMP’) file_num
,dbms_rowid.rowid_block_number(rowid) block_num
,dbms_rowid.rowid_row_number(rowid) row_num
from emp;

EMP_ID FILE_NUM BLOCK_NUM ROW_NUM
———-  ———-        ———-            ———-
100         4                   131                    0
101         4                   131                    1

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.