分类: Oracle
2010-12-03 15:01:14
SQL> set autotrace off
SQL> select rowid from hr.employees;
ROWID
-----------
AAAMg3AAFAAAABYABa
AAAMg3AAFAAAABYAAg
AAAMg3AAFAAAABYAAp
AAAMg3AAFAAAABYABf
AAAMg3AAFAAAABYAAG
AAAMg3AAFAAAABUAAI
AAAMg3AAFAAAABYABH
AAAMg3AAFAAAABYABQ
...
107 rows selected.
rowid格式如下:
AAAPW1--->数据对象编号
AAL--->文件编号
AAAAA1--->块编号
AAA---->行号
通过dbms_rowid包,直接得到具体的rowid包含的信息
SQL> select dbms_rowid.rowid_object(rowid) object_id,
2 dbms_rowid.rowid_relative_fno(rowid) file_id,
3 dbms_rowid.rowid_block_number(rowid) block_id,
4 dbms_rowid.rowid_row_number(rowid) num
5 from scott.dept;
OBJECT_ID FILE_ID BLOCK_ID NUM
---------- ---------- ---------- ----------
51146 4 16 0
51146 4 16 1
51146 4 16 2
51146 4 16 3
知道object_id,查找具体的信息
SQL> select OBJECT_NAME from dba_objects where OBJECT_ID=51146;
OBJECT_NAME
----------------
DEPT
知道file_id,查找具体的信息
SQL>select name,file#,ts# from v$datafile;
chinaunix网友2011-06-05 02:00:53
大连法律咨询在线 http://www.fabowang.com 大连律师在线咨询 http://www.fabowang.com 大连法律顾问网 http://www.fabowang.com 大连律师咨询 http://www.fabowang.com