• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 8225
  • Last Modified:

alter tablespace tablespace_name coalesce

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
harris2107
Asked:
harris2107
  • 2
1 Solution
 
johnsoneSenior Oracle DBACommented:
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
 
harris2107Author Commented:
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
 
johnsoneSenior Oracle DBACommented:
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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now