Re: Optimize Table

From: <>
Date: Thu, 31 Jan 2008 07:35:50 -0800 (PST)
Message-ID: <>

On Jan 31, 8:56 am, "" <> wrote:
> <> wrote in message
>> There is command 'Optimize Table' in MySQL. What is the equivalent of
> > this in Oracle?
> > And if none, how to optimize an Oracle (10g) table?
> > Thx.
> What does optimize table in your sql do?
> Jim

Had one decided to use one would have found this:

wherein the OPTIMIZE TABLE command is explained. Basically it repairs split (chained/migrated) rows, compacts free space, repairs indexes and updates table statistics. Thus, in 10.2 and later releases, which create statistics automagically, an

alter table <tablename> move;

followed by an

alter index <indexname> rebuild;

would perform similar 'magic'. Of course the antiquated exp/drop/imp scenario could still be used to 'optimize' the table. In either case the table is unavailable for use during the operation as both products lock the object for the duration of the process.

David Fitzjarrell Received on Thu Jan 31 2008 - 09:35:50 CST

Original text of this message