Reputation: 2986
High Water Mark (HWM) for a table in an Oracle Database is the line between blocks that have been used and ones that have never been. Truncating a table resets the HWM to zero.
Now, if I have a partitioned table, I'd like to know if the following is true:
alter table ... drop partition ...
affect table's HWM?The idea is I'd like to populate partition's tables with insert /*+ append */
(direct path insert), but it only writes data beyond the HWM, so will the space be reused if I recreate the partition? I failed to find information on this specific aspect.
Upvotes: 3
Views: 4213
Reputation: 17643
In addition to Dave Costa's answer, response to second question: If you truncate the partition, the HWM will be at zero, so the space will be regained for direct path insert(space will be used). If you drop the partition, the space will be free for any other segment to be used. In particular, for your new partition.
So, in fewer words:
Also, another trick to use if you want to reuse the space is to do an
alter table move partition
. This will "recreate" the partition, without loosing the data.
There are more details, but this is your question about.
Upvotes: 1
Reputation: 48121
Each partition is a separate segment, so each would have its own HWM. I presume that truncating the whole table would reset the HWM for all partitions. You can truncate individual partitions as well, which certainly would reset the HWM for the partition.
Upvotes: 4