- 最后登录
- 2013-11-14
- 在线时间
- 104 小时
- 威望
- 999
- 金钱
- 271
- 注册时间
- 2013-1-9
- 阅读权限
- 70
- 帖子
- 63
- 精华
- 0
- 积分
- 999
- UID
- 855
|
10#
发表于 2013-3-23 22:57:20
本帖最后由 Stone 于 2013-3-23 22:58 编辑
我的理解是如果单纯的使用delete去处理旧数据,而insert去继续增加数据,那么新insert的数据会在高水位以后,所以表会继续扩展,空间会继续占用。但是既然设计用了分区,如果能根据日期进行分区的drop的话,应该是可以及时回收空间的。
可以参考下面的文章解释,应该是比较清楚啦 :)
http://www.databasejournal.com/features/oracle/article.php/3070581/Deleting-Historical-Data-on-Oracle-Databases.htm
Highwater Mark and Delete Operation
Highwater Mark (HWM)
For each object, Oracle maintains a record of the highest relative block used to hold data.
HWM is the last data block formatted to receive data, not necessarily carrying data. The table highwater mark (HWM) is the number stored in the table segment header. Adding new data to the table moves HWM to the next block, or to the last used block. Oracle optimizer relies on the HWM during calculation for the full table scan, and on full table scans, Oracle optimizer will always scan all database blocks
until the HWM pointer. This highwater mark is maintained in multiples of five blocks. Oracle has provided a way to find HWM for the table using the DBMS_SPACE package, which is not dependent on the analyzed status of the table. Deleting data from the table leaves the HWM unchanged. The next table insert will use the first free block on the free block list, which is beyond the highwater mark causing the table to continue growing. |
|