ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Data block address

Data block address

原创 Linux操作系统 作者:小靓妞 时间:2011-05-23 14:38:18 0 删除 编辑

Data block address

From Oracle FAQ

A Data Block Address (DBA) is the address of an Oracle data block for access purposes.

Find the DBA for a given row

Start by getting the file and block number of the row. Example:

SQL> SELECT
2 dbms_rowid.rowid_relative_fno(rowid) REL_FNO,
3 dbms_rowid.rowid_block_number(rowid) BLOCKNO,
4 empno, ename
5 FROM emp WHERE empno = 7369;
REL_FNO BLOCKNO EMPNO ENAME
---------- ---------- ---------- ----------
4 20 7369 SMITH

Now, convert the file and block numbers to a DBA address:

SQL> variable dba varchar2(30)
SQL> exec :dba := dbms_utility.make_data_block_address(4, 20);
PL/SQL procedure successfully completed.
SQL> print dba
DBA
--------------------------------
16777236

Convert a DBA back to file and block numbers

Example:

SQL> SELECT dbms_utility.data_block_address_block(16777236) "BLOCK",
2 dbms_utility.data_block_address_file(16777236) "FILE"
3 FROM dual;
BLOCK FILE
---------- ----------
20 4

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

下一篇: Data block
请登录后发表评论 登录
全部评论

注册时间:2010-12-13

  • 博文量
    37
  • 访问量
    37972