sitemap

RSS地图

收藏本站

设为首页

Oracle研究中心

当前位置:Oracle研究中心 > 运维DBA >

学习笔记:分析数据库对象object_id与data_object_id区别与联系

时间:2016-06-06 10:16   来源:Oracle研究中心   作者:惜分飞   点击:

天萃荷净 分析Oracle数据库对象中object_id和data_object_id两个值的区别与联系

其实object_id和data_object_id同样是表示数据库对象的一个唯一标志,但是object_id表示的是逻辑id,data_object_id表示的是物理id。如果一些object没有物理属性的话那它就不存在data_object_id,例如procedure,function,package,data type,db link,mv定义,view定义,临时表,分区表定义等等这些object都是没有对应着某个segment,因此它们的data_object_id都为空。

当表刚创建的时候它的object_id和data_object_id都是相等的,但是如果表经过move或truncate等,涉及到segment发生改变后data_object_id将会有变化。

DATA_OBJECT_ID was introduced in 8.0 to track versions of the same segment (certain operations change the version). It is used to discover stale ROWIDs and stale undo records.

SQL> create table oracleplus as select * from dba_objects where rownum<100;
 
Table created
 
SQL> select object_id,data_object_id from user_objects where object_name='oracleplus';
 
 OBJECT_ID DATA_OBJECT_ID
---------- --------------
    211325         211325
 
SQL> alter table oracleplus move;
 
Table altered
 
SQL> select object_id,data_object_id from user_objects where object_name='oracleplus';
 
 OBJECT_ID DATA_OBJECT_ID
---------- --------------
    211325         211326
 
SQL> truncate table oracleplus;
 
Table truncated
 
SQL> create index ind_oracleplus on oracleplus(object_id);
 
Index created
 
SQL>  select object_id,data_object_id from user_objects where object_name='IND_oracleplus';
 
 OBJECT_ID DATA_OBJECT_ID
---------- --------------
    211328         211328
 
SQL> ALTER INDEX IND_oracleplus REBUILD;
 
Index altered
 
SQL>  select object_id,data_object_id from user_objects where object_name='IND_oracleplus';
 
 OBJECT_ID DATA_OBJECT_ID
---------- --------------
    211328         211329


--------------------------------------ORACLE-DBA----------------------------------------

最权威、专业的Oracle案例资源汇总之学习笔记:分析数据库对象object_id与data_object_id区别与联系

本文由大师惜分飞原创分享,网址:http://www.oracleplus.net/arch/290.html

Oracle研究中心

关键词:

分析数据库对象object_id与data_object_id

object_id与data_object_id区别与联系