what is the difference between object_id and data_object_id?

[b]
The object_id is the primary key, the data_object_id is the foreign key to the data segment.

You can find the DDL operation against the object (for instance,
Truncate,Move etc.)by querying the dba_objects with object_id not equal to data_object_id.


[/b]


[quote]

Hi Tom,

For some objects in dba_objects, I see object_id is not matching with data_object_id even
when that object is not part of the cluster.

21:35:49 SQL> select count(*) from dba_objects where
data_object_id is not null and
object_name not in (
select distinct table_name from dba_clu_columns)
/

COUNT(*)
----------
5930

Can you please explain why they are different and what could cause that.

Thanks.

and we said...

The object_id is the primary key, the data_object_id is the foreign key to the data
segment.

Initially they are "the same"

But any operation that radically changes the data segment - eg: truncate, alter table
exchange partition, etc -- will change the data_object_id -- the data segment the object
points to.


consider:

ops$tkyte@ORA9IR2> create table t ( x int );

Table created.

ops$tkyte@ORA9IR2>
ops$tkyte@ORA9IR2> select object_name, object_id, data_object_id
2 from user_objects
3 where object_name = 'T';

OBJECT_NAME OBJECT_ID DATA_OBJECT_ID
------------------------------ ---------- --------------
T 29413 29413

ops$tkyte@ORA9IR2>
ops$tkyte@ORA9IR2> truncate table t;

Table truncated.

ops$tkyte@ORA9IR2>
ops$tkyte@ORA9IR2> select object_name, object_id, data_object_id
2 from user_objects
3 where object_name = 'T';

OBJECT_NAME OBJECT_ID DATA_OBJECT_ID
------------------------------ ---------- --------------
T 29413 29414

ops$tkyte@ORA9IR2>
ops$tkyte@ORA9IR2> alter table t move;

Table altered.

ops$tkyte@ORA9IR2>
ops$tkyte@ORA9IR2> select object_name, object_id, data_object_id
2 from user_objects
3 where object_name = 'T';

OBJECT_NAME OBJECT_ID DATA_OBJECT_ID
------------------------------ ---------- --------------
T 29413 29415

[/quote]


Refer Weblink:
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:23417970272903
http://space.itpub.net/17203031/viewspace-690629
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值