> }
> } >
> } > At 09:53 PM 12/23/94 -0500, Borg Boy wrote:
> } > >Question: Will unloading a database using tbunload, then dropping
> > it, and
> } > >loading it back in using tbload defrag the tables?
> } > >
> } Jon Vemo sez:
> } > NO. tbunload performs a binary unload of each page, page for page.
> > Any } fragmentation which existed before, will still be there after
> > tbload'ing.
> } >
> }
> } I thought 'tbunload,drop,tbload' was one of the sanctioned methods for
> } defragging disc space. What does one use?
> }
>
> tbload/tbload does re-extent tables. What it doesn't do is shrink
tables
> that have had many rows deleted. For that you have to unload/dbload the
> table.
Surely, 're-extenting' tables will effectively shrink them. As I
understand it tbunload/ tbload work at page level, so the only defragging
that won't get done is that within pages (of which the only examples I
can think of are pages with deleted rows, reallocation of modified
varchars and index compression), and physical page sequence.
Completely dead pages will not get re-created, and tbload will only
allocate sufficient extents to accommodate the pages which have got
something in them.
The simplest way to force complete table compression is ALTER INDEX TO
CLUSTER (IIRC this is what the manual recommends), but you have to have
enough room in the dbspace for the new, re-built table before it drops
the old one.
akent@cix.compulink.co.uk (Andy Kent)
-------------------------------------