ITPub博客

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

object_id与data_object_id的关系

原创 Linux操作系统 作者:paulyibinyi 时间:2008-01-07 15:59:54 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' A
ND WNER='SYS';

 OBJECT_ID DATA_OBJECT_ID
---------- --------------
      6680           6680

SQL> select header_file,header_block,blocks from dba_segments where segment_name
='TEST' and WNER='SYS';

HEADER_FILE HEADER_BLOCK     BLOCKS
----------- ------------ ----------
          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
ND WNER='SYS';

 OBJECT_ID DATA_OBJECT_ID
---------- --------------
      6680           6681

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

SQL> select header_file,header_block,blocks from dba_segments where segment_name
='TEST' and WNER='SYS';

HEADER_FILE HEADER_BLOCK     BLOCKS
----------- ------------ ----------
          1        43105         16

SQL> truncate table test;

Table truncated.

SQL> select header_file,header_block,blocks from dba_segments where segment_name
='TEST' and WNER='SYS';

HEADER_FILE HEADER_BLOCK     BLOCKS
----------- ------------ ----------
          1        43105          8

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

 OBJECT_ID DATA_OBJECT_ID
---------- --------------
      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' A
ND WNER='SYS';

 OBJECT_ID DATA_OBJECT_ID
---------- --------------
      6680           6682

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

所以总上所简述

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

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

两者值是相等的

 

 

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

下一篇: exists 的问题
请登录后发表评论 登录
全部评论
学习数据库

注册时间:2007-12-11

  • 博文量
    902
  • 访问量
    6576623