Shrinking tablespaces

As you might know, Oracle uses tablespaces to store the tables and the data within them. If you drop tables and/or users, the tablespace is not automagically shrunk to it’s minimal size. While playing around with my local database, I imported a lot of (big) tables. I wanted to reload a schema, but before I did that, I wanted to shrink my tablespace to it’s minimal size. I could of course do this using the Enterprise Manager Console, but that would mean shrinking by trial and error. However, I found a script (via) that checks the minimal size of my tablespace and then generates a statement to shrink the tablespace to this minimal size. For your convenience I have copied the script so you can download it here.

Leave a Reply

Your email address will not be published. Required fields are marked *