Thursday 4 January 2007

Defragmenting Tables

This is the best way to defrag a table:

alter table tablename
move tablespace tablespacename

But be careful doing this means the table's indexes will become unstable and so you need to rebuild all the indexes again:

ALTER INDEX index_name REBUILD

No comments: