Solved

alter tablespace tablespace_name coalesce

Posted on 2007-03-21
3
8,007 Views
Last Modified: 2013-12-21
Hi,
       Can i use safely  "ALTER TABLESPACE  tablespace_name COALESCE" to free up unused space in any tablespace ( like ununsed extents). Is there any way to find if a tablespace needs to be COALESCED to free up space before we go ahead adding space to tablespace using "ADD DATAFILE" clause? Is there any disadvantange or any other complication using this "COALESCE" command or is it safe enough?

Thanks,
Harris.
0
Comment
Question by:harris2107
  • 2
3 Comments
 
LVL 34

Accepted Solution

by:
johnsone earned 250 total points
ID: 18766556
Coalescing a tablespace will take groups of contiguous free blocks and put them back together into one free segment.  It does not free any space from objects.

You cannot free space for a table that is above the high water mark.  One of the easiest ways to get back space for a table is to use:

ALTER TABLE <tab> MOVE TABLESPACE <ts>;

This will rebuild the table into the specified tablespace (you can use the same one).
0
 

Author Comment

by:harris2107
ID: 18767067
Yes, i understood that. The Coalesce command takes groups of contigous free blocks (which are left unused in the used segments) and puts them back into a usable piece of segment, (something like defragmentation). My question is, will this COALESCE command any other things than just grouping blocks? We can use this safely with out any problem on all the tablespaces right?
0
 
LVL 34

Expert Comment

by:johnsone
ID: 18770689
That is all it does.  If you are using locally managed tablespaces and uniform block size, there is no reason to ever coalesce.  You will not fix any fragmentation as the blocks will be split up back into the same chunks they are in now.

There is no harm using it on any tablespaces.  I am not entirely sure if it is valid on temporary tablespaces, but the worst thing that will happen is you will get an error when you run the command.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Oracle Pivot Question 8 71
Help on model clause 5 37
Problem with duplicate records in Oracle query 16 40
UNIX Script. Send email if failure 8 30
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question