resources - Oracle 10g Table size after deletion of multiple rows -
as part of maintenance, remove considerable amount of records 1 table , wish dispose of space other table. thing i'm checking size of table , shows same original size before delete. missing here?
to check size, i'm looking @ dba_segments
.
there concepts need know tables before can understand space usage. try , give 5 second tour ...
a table made of extents, these can vary in size, lets assume 1mb chunks here.
when create table, 1 extent added it, though table has no rows, occupy 1mb.
when insert rows, oracle has internal pointer table known high water mark (hwm). below hwm, there formatted data block, , above there unformated blocks. starts @ zero.
if take new table example, , start inserting rows, hwm move up, giving more , more of first extent used table. when extent used up, 1 allocated , process repeats.
lets says fill 3 1mb extents , delete rows - table empty, oracle not move hwm down, or free used extents. table take 3mb on disk though empty, there 3mb of free space reused in it. new inserts go space below hwm until filled again before hwm move again.
to recover space, if table using assm, can use command:
alter table t1 shrink space;
if not using assm, need think table reorg recover space.
Comments
Post a Comment