Re: Rebuild table

From: Hemant K Chitale <hemantkchitale_at_gmail.com>
Date: Wed, 22 Jun 2011 15:41:13 +0800
Message-ID: <BANLkTikGAZcV0B6e99QM5+Mufdq0xHoEWg_at_mail.gmail.com>



>I deleted rows out of it until I had only 6k rows

Given that you have only 6K rows left,
ALTER TABLE tablename ENABLE ROW MOVEMENT; ALTER TABLE tablename SHRINK SPACE;
ALTER TABLE tablename DEALLOCATE UNUSED ;

is the easiest course of action.

An alternate course would be to
ALTER TABLE tablename MOVE ;
followed by
ALTER INDEX indexN REBUILD ;
for each index 1 to N on the table.

Does the table have any LOB (CLOB, BLOB) columns ? Are they stored out of line ?
(You would find such a segment by querying USER_SEGMENTS and USER_LOBS). You'd need to rebuild the LOB segment as well.

On Wed, Jun 22, 2011 at 4:19 AM, Joe Smith <joe_dba_at_hotmail.com> wrote:

>
> I have a table that had 16 million records in it. I deleted rows out of it
> until I had only 6k rows. But I still have 57k blocks (8k size).
>
> What is the best way to rebuild the table? The table is varchar2 and
> number datatypes.
>
>

-- 

Hemant K Chitale
http://hemantoracledba.blogspot.com

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Jun 22 2011 - 02:41:13 CDT

Original text of this message