Solved

alter tablespace tablespace_name coalesce

Posted on 2007-03-21
3
7,953 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Add 0 to end of Number 21 71
levels for reporting 5 51
Oracle PL/SQL syntax 4 52
sql query 5 52
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now