dbTalk Databases Forums  

object_id vs data_object_id in user_objects

comp.databases.oracle comp.databases.oracle


Discuss object_id vs data_object_id in user_objects in the comp.databases.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jack
 
Posts: n/a

Default object_id vs data_object_id in user_objects - 03-02-2005 , 05:50 PM






I would like to ask for clarification on the meaning of these two
columns. According to the 9i Ref, object_id is the dictionary object
number of the object and data_object_id is the dictionary object number
of the segment that contains the object.

First question, what's the difference? Sorry to sound philosophic here,
but how could an object exist without a segment? Obviously it does, but
I could sure use some description of how to interpret the difference.

Second question,

Scenario:

Insert and commit two rows in a table.

Query user_objects for the table, object_id and data_object_id have the
identical value: 31264.

Delete both rows and commit, the columns still have identical values.

Reinsert the rows, commit and truncate the table, object_id is still
31264, data_object_id is now 31265.

Maybe the answer to my first question will clear this up, but at this
point I'm baffled about how the "style" of removing rows from a table
can cause the table's segment id to change? Isn't it the same segment?

Thanks for any illumination anyone can throw.

Jack


Reply With Quote
  #2  
Old   
Mark.Powell@eds.com
 
Posts: n/a

Default Re: object_id vs data_object_id in user_objects - 03-04-2005 , 09:03 AM






The data object id is assigned at creation time and does not change
unless the object is dropped and recreated. The data_object_id is also
assigned at creation time but over time the segment used to store the
object can be changed.

Observe
UT1 > select object_id, data_object_id from dba_objects
2 where object_name = 'MARKTEST_IDX1';

OBJECT_ID DATA_OBJECT_ID
---------- --------------
31698 31699

UT1 > alter index marktest_idx1 rebuild;

Index altered.

UT1 > select object_id, data_object_id from dba_objects
2 where object_name = 'MARKTEST_IDX1';

OBJECT_ID DATA_OBJECT_ID
---------- --------------
31698 31980

The data_object_id changed to reflect the new segment used to house the
index.

run this query
select owner, object_name, object_type, object_id, data_object_id
from dba_objects
where object_id <> data_object_id

And take a look at what turns up.

HTH -- Mark D Powell --


Reply With Quote
  #3  
Old   
Jack
 
Posts: n/a

Default Re: object_id vs data_object_id in user_objects - 03-04-2005 , 11:57 AM



Thanks Mark.

My follow up question is why truncating the table resulted in a new
segment but deleting rows and committing didn't. I think that what I am
sniffing around is something I've seen referred to as the "highwater
mark". If that's related, can you recommend a good ref so I can pursue
this on my own? I have read what the 9i Concepts book has to say about
this, but it didn't help.

Thanks again.

p.s. I used to work for EDS at the Camp Hill data center a long time
ago.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.