对于这两个子段,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/