查找对象的文件号、块号,RDBA

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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值