ITPub博客

转换RDBA的文件和数据块地址(转)

原创 Linux操作系统 作者:oracle_ace 时间:2007-12-17 15:49:12 0 删除 编辑
http://www.eygle.com/archives/2004/08/how_to_dump_datablock.html

看了eygle一篇文章转一下,算是记录了:)
主要是通过以下脚本,来转换RDBA和数据块的地址
CREATE OR REPLACE FUNCTION getbfno (p_dba IN VARCHAR2)
   RETURN VARCHAR2
IS
   l_str   VARCHAR2 (255) DEFAULT NULL;
   l_fno   VARCHAR2 (15);
   l_bno   VARCHAR2 (15);
BEGIN
   l_fno :=
      DBMS_UTILITY.data_block_address_file (TO_NUMBER (LTRIM (p_dba, '0x'),
                                                       'xxxxxxxx'
                                                      )
                                           );
   l_bno :=
      DBMS_UTILITY.data_block_address_block (TO_NUMBER (LTRIM (p_dba, '0x'),
                                                        'xxxxxxxx'
                                                       )
                                            );
   l_str :=
         'datafile# is:'
      || l_fno
      || CHR (10)
      || 'datablock is:'
      || l_bno
      || CHR (10)
      || 'dump command:alter system dump datafile '
      || l_fno
      || ' block '
      || l_bno
      || ';';
   RETURN l_str;
END;
/

有了这个函数,很是方便:
SQL> select getbfno('0x00406991') bfno from dual;

BFNO
------------------------------------------------------------
datafile# is:1
datablock is:27025
dump command:alter system dump datafile 1 block 27025;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12361284/viewspace-727/,如需转载,请注明出处,否则将追究法律责任。

上一篇: data block的转储
请登录后发表评论 登录
全部评论

注册时间:2007-12-10

  • 博文量
    284
  • 访问量
    783564