eygle.com   eygle.com
eygle.com  
 

« 《深入浅出Oracle》技术交流会PPT下载 | Blog首页 | DBA语录之:规范的重要 »

Oracle HowTo:使用DBMS_UTILITY转换Block地址

作者:eygle |【转载时请以超链接形式标明文章和作者信息及本声明
链接:

很多时候,我们可以从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

-The End-

 


历史上的今天...
      >> 2009-09-04文章:
      >> 2008-09-04文章:
             香港的旺角 梦幻的城市
      >> 2007-09-04文章:
             Oracle 11g新特性:Result Cache之一
      >> 2005-09-04文章:
             Oracle 10g Linux ASMLib Install Notes
------
这篇 【Oracle HowTo:使用DBMS_UTILITY转换Block地址】来自 eygle.com | CSDN网摘| del.icio.us|Google订阅 | 鲜果订阅 | 抓虾订阅

By eygle on 2006-09-04 15:10 | Comments (0) | Posted to HowTo | Edit |

相关文章 随机文章
  • 何去何从 - 关于DBA前途问题的探讨
  • DBA日常工作职责 - 我对DBA的七点建议
  • 谁与争锋-数据库管理工具OEM、I3的取舍
  • Oracle Database 10g 与 DBA 2.0的时代
  • DBA 2.0的时代与 Oracle促进的变革
  • 我的搬家历程
    Install Oracle9iRac On Solaris + EMC + Veritas ---All the things you should know
    摄影习作-花之灵
    Oracle诊断案例-Spfile案例一则
    Oracle10g的ASH及历史信息记录
    搜索本站:

    留言 (0)

    发表留言:



    Remember Me?
    (输入验证码后方可评论,谢谢支持)



    CopyRight © 2004~2010 eygle.com, All rights reserved.