Tablespace fragmentation
Hi Guys,
I've got a client who wants me to rebuild all tables in a specific tablespace. Now I know that 2 tables were a problem in this tablespace because the PCT_INCREASE was set to 25, making the extents 180mb at one point. I have already altered the tables to change the next extent size. I am not sure on how I should proceed in defragmenting the tablespace. Any ideas?
The end result should be to fix all entents to be a uniform size and have all free space in the tablespace be contiguous.
Should I do (as an example):
(The tablespace name is : MY_DATA)
- Defragment the Table:
ALTER TABLE MERCHANT.HIST_STYLE STORAGE (NEXT 4M PCTINCREASE 0)
ALTER TABLE MERCHANT.HIST_STYLE MOVE TABLESPACE MY_DATA NOLOGGING
Then:
- Defragment the Tablespace:
(1)export using owner mode, compress = Y.
(2)drop the tablespace.
(3)create the tablespace.
(4)import
or should I :
- Defragment the Table:
ALTER TABLE MERCHANT.HIST_STYLE STORAGE (NEXT 4M PCTINCREASE 0)
ALTER TABLE MERCHANT.HIST_STYLE MOVE TABLESPACE MY_DATA NOLOGGING
Then:
ALTER TABLESPACE MY_DATA COALESCE;
Or are these options not correct?
|