SQL> select id,rowid,
2 dbms_rowid.rowid_relative_fno(rowid) file#,
3 dbms_rowid.rowid_block_number(rowid) block#,
4 dbms_rowid.rowid_row_number(rowid) row#,
5 dbms_rowid.rowid_object(rowid) object# from t;
ID ROWID FILE# BLOCK# ROW# OBJECT#
---------- ------------------ ---------- ---------- ---------- ----------
1 AAADaXAAEAAAADJAAA 4 201 0 13975
2 AAADaXAAEAAAADJAAB 4 201 1 13975
3 AAADaXAAEAAAADJAAC 4 201 2 13975
#查找数据块的RDBA
SQL> select dbms_utility.make_data_block_address(4,201) from dual;
DBMS_UTILITY.MAKE_DATA_BLOCK_ADDRESS(4,201)
-------------------------------------------
16777417
#根据RDBA查看数据块文件号,块号
SQL> SELECT dbms_utility.data_block_address_file(16777417) file#,
2 dbms_utility.data_block_address_block(16777417) block# from dual;
FILE# BLOCK#
---------- ----------
4 201
--进制转换
trace内容:
Block dump from cache:
Dump of buffer cache at level 4 for tsn=4 rdba=16777417
BH (0x83fdd788) file#: 4 rdba: 0x010000c9 (4/201) class: 1 ba: 0x83cc6000
# 16进制转为10进制
SQL> select to_number('10000c9','xxxxxxxx') from dual; #参数用单引号括起
TO_NUMBER('10000C9','XXXXXXXX')
-------------------------------
16777417
# 10进制转为16进制
SQL> select to_char(16777417,'xxxxxxxx') from dual; #参数不用单引号括起
TO_CHAR(1
---------
10000c9