Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to free up space in Tablespace?

914805Mar 1 2012 — edited Mar 3 2012
My SQL is quite decent but not perfect.

I'm using the following sql query to find out the tablespace's free space:

select b.tablespace_name, tbs_size SizeMb, a.free_space FreeMb
from (select tablespace_name, round(sum(bytes)/1024/1024 ,2) as free_space
from dba_free_space
group by tablespace_name) a,
(select tablespace_name, sum(bytes)/1024/1024 as tbs_size
from dba_data_files
group by tablespace_name) b
where a.tablespace_name(+)=b.tablespace_name;

I can see that one tablespace (custom made) is using up a lot of space so i want to free up some space. How can i do that?

I tried the following but still when running that query it still outputs the same:

- delete rows (tried using both delete & truncate commands) from schemas (tables) that belong to that tablespace
- drop unused schemas (tables) that belong to that tablespace

even tried disconnecting my session and reconnecting again but running that query still returns teh same results :s

Help much appreciated!

regards,

cheers
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 31 2012
Added on Mar 1 2012
9 comments
4,504 views