• Script:Translate RDBA relative data block address


    Script:Translate RDBA relative data block address  
    -- scripts/admin/rdba/rdba_to_file_block.sql
    select trunc( to_number('&rdba','XXXXXXXX')
                / power(2,22) ) as rfile#
         , trunc(to_number('&rdba','XXXXXXXX')-
              trunc( to_number('&rdba','XXXXXXXX')
                   / power(2,22))*power(2,22) ) as block#
      from dual
    /
    
    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;
    /
    
    select getbfno('0x00400009') from dual;
  • 相关阅读:
    一个体验好的Windows 任务栏缩略图开发心得
    扫脸动画
    ShimmerTextView
    201512-2 消除类游戏 (水题,暴力)
    CCF 201512-1 数位之和 (水题)
    UVa 557 Burger (概率+递推)
    CCF 201604-2 俄罗斯方块 (模拟)
    CCF 201604-1 折点计数 (水题,暴力)
    UVa 10213 How Many Pieces of Land ? (计算几何+大数)
    UVa 1641 ASCII Area (计算几何,水题)
  • 原文地址:https://www.cnblogs.com/macleanoracle/p/2967268.html
Copyright © 2020-2023  润新知