关于object_id 和data_object_id

对于这两个子段,Oracle给出了定义:

OBJECT_ID: Object number of the object
DATA_OBJECT_ID: Dictionary object number of the segment that contains the object

也就是说,object_id是schema下唯一的对象的标识,而data_object_id是该对象存储的标识,对于没有独立存储的对象,自然也就没有data_object_id了:

 

SQL> select object_type,object_id,data_object_id from all_objects where object_type in ('VIEW','PROCEDURE','FUNCTION')
  2  and rownum < 10;

OBJECT_TYPE          OBJECT_ID DATA_OBJECT_ID
------------------- ---------- --------------
VIEW                      1200
VIEW                      1211
PROCEDURE                90952              0
PROCEDURE                90744              0

对于heap table,这两个是相等的:

SQL> select object_name,object_id,data_object_id
  2  from all_objects
  3  where object_name = 'T1';

OBJECT_NAME                     OBJECT_ID DATA_OBJECT_ID
------------------------------ ---------- --------------
T1                                  91066          91066

SQL>

然后建立簇表看看:

SQL> create cluster c1(deptid int);

Cluster created.

SQL> create table test1(deptid int,dname varchar2(35)) cluster c1(deptid);

Table created.

SQL> create table test2(eeid int,deptid int) cluster c1(deptid);

Table created.

SQL> select object_name,object_id,data_object_id
  2  from all_objects
  3  where object_name in('C1','TEST1','TEST2');

OBJECT_NAME                     OBJECT_ID DATA_OBJECT_ID
------------------------------ ---------- --------------
TEST1                               91064          91063
C1                                  91063          91063
TEST2                               91065          91063

可以看到,这时候这三个对象的data_object_id都是C1的;

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

转载于:http://blog.itpub.net/45259/viewspace-660324/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值