ITPub博客

首页 > Linux操作系统 > Linux操作系统 > object_id与data_object_id的关系

object_id与data_object_id的关系

原创 Linux操作系统 作者:zwc1083 时间:2009-03-13 19:45:11 0 删除 编辑

object_id 是逻辑对象ID

data_object_id 是物理对象ID

SQL> create table test as select rownum rn from dba_objects;

Table created.

SQL> select object_id,data_object_id from dba_objects where object_name='TEST' ND WNER='SYS';

 OBJECT_ID DATA_OBJECT_ID
0J ]?*y,}}14876437---------- --------------6680           6680

SQL> select header_file,header_block,blocks from dba_segments where segment_nameITPUB个人空间u"R~1|6D(^
='TEST' and WNER='SYS';

HEADER_FILE HEADER_BLOCK     ----------- ------------ ----------ITPUB个人空间y0h p+DP/^9~Et
          1        42921         16

SQL> alter table test move;

Table altered.

SQL> select object_id,data_object_id from dba_objects where object_name='TEST' A
o:@^0j+[:q m14876437ND WNER='SYS';

 OBJECT_ID DATA_OBJECT_ID
8X(D I8hLWA7g;t R.d14876437---------- --------------ITPUB个人空间5Q*} AJ%}%UL
      6680           6681

表经过move后,物理ID发生变化

SQL> select header_file,header_block,blocks from dba_segments where segment_nameITPUB个人空间&y&d9Ls.}x(D,X
='TEST' and WNER='SYS';

HEADER_FILE HEADER_BLOCK     BLOCKSITPUB个人空间!Yge k'nLI#lO9o
----------- ------------ ----------
?r5m\&]14876437          1        43105         16

SQL> truncate table test;

Table truncated.

SQL> select header_file,header_block,blocks from dba_segments where segment_nameITPUB个人空间o}G6s2hA%O![
='TEST' and WNER='SYS';

HEADER_FILE HEADER_BLOCK     BLOCKS
G,[-c F x)l1p9sE14876437----------- ------------ ----------ITPUB个人空间g%v8`d$a3`m*y:r$w
          1        43105          8

SQL> select object_id,data_object_id from dba_objects where object_name='TEST' AITPUB个人空间e _Y{2r g4a
ND WNER='SYS';

 OBJECT_ID DATA_OBJECT_ID
#`.[dS4N%L,f14876437---------- --------------ITPUB个人空间GZ(}K7E:McN
      6680           6682

表经过truncate 后 物理ID也发生变化

 

SQL> alter table test add(n number);

Table altered.

SQL> select object_id,data_object_id from dba_objects where object_name='TEST' AITPUB个人空间q:{'lj b ]Q
ND WNER='SYS';

 OBJECT_ID DATA_OBJECT_ID
S/e'HiY-B|14876437---------- --------------
"N4h'rF[u.{x.e$}JD14876437      6680           6682

给表增加一个列,也没发生变化

所以总上所简述

只有当segment发生变化时data_object_id才发生变化

有时候我们根据rowid 算时得到的data_object_id会误以为就是object_id,因为要是没有发生segment变化时

两者值是相等的

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

上一篇: 执行计划分析
请登录后发表评论 登录
全部评论

注册时间:2009-02-16

  • 博文量
    91
  • 访问量
    43590