QUOTE:
最初由 biti_rainy 发布
truncate 的时候data_object_id重新生成,HWM被移动到紧靠segment header 的block。 data_object_id 的变化表示 segment 重新产生过。至于增加2,这个2并没有什么含义,只是 增大而已。
I'm puzzled by the increment 2. Why 2? This 2 seems to be independent of whether the table has dependent objects (indexes, etc.) or how many rows are in the table.
By the way, if the table is already empty, truncate won't increment data_object_id. But alter table move always does. The increment due to table move seems to be related to the number of blocks in the table. In this sense, we can say alter table move definitely recreates the segment but saying truncate does it too is a little far-fetched, in my opinion.
One more case where data_object_id increments is, similar to table "rebuild" or move, alter index rebuild.
Other useful things worth remembering. You use data_object_id in v$bh and x$bh, but object_id in v$locked_object.
Yong Huang