HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMinor

How to retrieve disk spaces by removing tables from tablespaces in Oracle 10g?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
oracletablesremovingdisk10gspacesretrievetablespaceshowfrom

Problem

I'm using a Oracle 10g database.
I have a big tablespace MYTBS made of a dozen data files (MYTBS_01, MYTBS_02, ...) of different sizes which have been added through the years.

Now i have removed very big tables from this tablespace and i would like to retrieve disk space on the server.

How can i be able to free up space/blocks from the tablespace ?

Solution

You need to shrink the data files, which can be tricky.

However, possibly the easier method to describe and implement is to create a new tablespace of approximately the right size, use ALTER TABLE to move the table segments, and ALTER INDEX to rebuild the indexes in the new tablespace. When the old tablespace is empty of objects you can drop it.

Oracle Enterprise Manager can do this automatically for you. This is described in detail in this post: http://www.oracle-base.com/articles/misc/reclaiming-unused-space.php#em_reorg

Context

StackExchange Database Administrators Q#33396, answer score: 7

Revisions (0)

No revisions yet.