您的位置: 首页 计算机类> Oracle认证> 应用技术
公务员考试辅导课程

使用DBMS_UTILITY转换Block地址

发布时间:11-09

页 数:1页

上一篇:ORACLE认证相关问题与解答1

下一篇:AIX下字符界面安装oracle10g过程


很多时候,我们可以从Oracle的Trace文件中获得Block的DBA(Data Block Address),有时候需要对这个地址进行转换才能得到相应的Block地址。

有的trace文件中已经包含了地址转换,例如: 

Start dump data blocks tsn: 4 file#: 4 minblk 465 maxblk 465
buffer tsn: 4 rdba: 0x010001d1 (4/465)

而有时候trace文件里只包含一个RDBA,比如上周我们遇到的一个案例:

oer 8102.2 - obj# 111465, rdba: 0x08811ba3
kdk key 8102.2:
  ncol: 2, len: 15
  key: (15):  07 78 6a 08 1f 01 14 15 06 06 00 00 06 00 73
  mask: (4096):

这里的Rdba我们怎样才能转换为文件号和数据块号呢?

通过手工转换,可以参考如下文章:

http://www.eygle.com/archives/2004/08/how_to_convert_rdba.html

Oracle同时提供一个系统包 dbms_utility 可以用于对RDBA进行转换。

注意,对于上面的 rdba: 0x08811ba3,首先要做一个16进制到10进制的转换,转换方法参考:

http://www.eygle.com/archives/2004/06/oracle_howto_convert.html

下面我们使用dbms_utility 来进行转换:

SQL> variable file# number
SQL> variable block# number
SQL> execute :file#:=dbms_utility.data_block_address_file(to_number('8811ba3','xxxxxxx'));

PL/SQL procedure successfully completed.

SQL> execute :block#:=dbms_utility.data_block_address_block(to_number('8811ba3','xxxxxxx'));

PL/SQL procedure successfully completed.

SQL> print file#

     FILE#
----------
        34

SQL> print block#

    BLOCK#
----------
     72611

这样就可以通过dba_extents获得相关对象信息。

当然这里oer 8102.2 的信息已经告诉我们,出问题的是一个索引: 

$ oerr ora 8102
08102, 00000, "index key not found, obj# %s, dba %s (%s)"
// *Cause:  Internal error: possible inconsistency in index
// *Action:  Send trace file to your customer support representative, along
//           with information on reproducing the error





     

考试信息

热点排行

最近更新

考试辅导

网校辅导

面授培训

©2006-2008 100ksw.com 版权所有 皖ICP备06013378号