I can not - file size is max allowed by OS size.
ok - lets rephrase question - how to compress file so it will have all empty blocks contiguous?
Main Topics
Browse All TopicsHow to fix this?
ORA-01653: unable to extend table xxx by xxx
tablespace has 12 Gb free space
table next extent is 100K
alter tablespace xxx coalesce doesnt help
any other ideas?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
select tablespace_name, sum(bytes)/1024/1024 from dba_free_space group by tablespace_name;
What does that show for your tablespace?
alter table abc move tablespace def;
where abc is the name of the table and def is a tablepsace that is large enlugh to hold the table. If you do that with all your tables/indexes in the ts and then move them back, you'll have reclaimed space. If you know some tables with large delete activity, try just that one and it may be enough.
The immediate issue is the ORA-01653 and the second issue is hte amount of free space (and still needing to extend).
Why don't you add another data file to get rid of the ORA-01653.
As for the free space, MathiasMagnusson's suggestion sounds good, if you can afford the downtime. I suggest you startup the database in restricted mode OR insure the applicaiton using the tables/indexes in the tablepspace are not running.
Bertram Moshier
Oracle Certified Professional 8i and 9i DBA
http://www.bmoshier.net/be
1. Verify that the next extent size for the table is indeed 100k. If you allocated as
storage (initial 100k next 100k pctincrease 50) or some other pctincrease other than 0
then your next extent grows to 150 then 225 etc. If your table has many extents the next extent might be larger than you expect.
2. Yes this could have been prevented. Use Locally managed tablespaces with uniform extent sizes. If you are on a pre-8i version of Oracle you don't have LMT. Let me know and I can summarize an Oracle white paper on how to simulate LMT and put a link to the paper.
I cut this from Metalink. I prefer the uniform extent size option. That way, you can make your extent size 1m, then every allocation in the tablespace is 1m so every free chunk is a multiple of 1m.
A Locally Managed Tablespace is a tablespace that manages its own extents maintaining a bitmap in each datafile to keep track of the free or used status of blocks in that datafile. Each bit in the bitmap corresponds to a block or a group of blocks. When the extents are allocated or freed for reuse, Oracle changes the bitmap values to show the new status of the blocks. These changes do not generate rollback information because they do not update tables in the data dictionary (except for tablespace quota information), unlike the default method of Dictionary - Managed Tablespaces.
** Reduced recursive space management
** Reduced contention on data dictionary tables
** No rollback generated
** No coalescing required
Advantages
- Because locally managed tablespaces do not record free space in data dictionary, it reduces contention on these tables.
- Local management of extents automatically tracks adjacent free space, eliminating the need to coalesce free extents.
- Avoids recursive space management operations, which can occur in dictionary-managed tablespaces if consuming or releasing space in an extent results in another operation that consumes or releases space in a rollback segment or data dictionary table.
- Sizes of extents that are managed locally can be determined automatically by the system. Alternatively, all extents can have the same size in a locally managed tablespace.
- Changes to the extent bitmaps do not generate rollback information because they do not update tables in the data dictionary (except for special cases such as tablespace quota information).
- Reduced fragmentation
LMT (Locally Managed Tablespaces) improve performance (for one because to allocate/deallocate an extent the system no longer has to touch the data dictionary).
BTW, Oracle stated direction is to only support LMT in the future.
LMT are the only way to go in Oracle 9i!
Bertram Moshier
Oracle Certified Professional 8i and 9i DBA
http://www.bmoshier.net/be
This is from Metalink, it addresses the immediate issue:
Error: ORA-01653
Text: unable to extend table %s.%s by %s in tablespace %s
--------------------------
Cause: Failed to allocate an extent for table segment in tablespace.
Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more
files to the tablespace indicated.
Explanation:
------------
This error does not necessarily indicate whether or not you have enough space
in the tablespace, it merely indicates that Oracle could not find a large enough area of free
contiguous space in which to fit the next extent.
Diagnostic Steps:
-----------------
1. In order to see the free space available for a particular tablespace, you must
use the view DBA_FREE_SPACE. Within this view, each record represents one
fragment of space. How the view DBA_FREE_SPACE can be used to determine
the space available in the database is described in:
[NOTE:121259.1] Using DBA_FREE_SPACE
2. The DBA_TABLES view describes the size of next extent (NEXT_EXTENT) and the
percentage increase (PCT_INCREASE) for all tables in the database.
The "next_extent" size is the size of extent that is trying to be allocated (and for
which you have the error).
When the extent is allocated :
next_extent = next_extent * (1 + (pct_increase/100))
Algorythm to allocate extent for segment is described in the Concept Guide
Chapter : Data Blocks, Extents, and Segments - How Extents Are Allocated
3. Look to see if any users have the tablespace in question as their temporary tablespace.
This can be checked by looking at DBA_USERS (TEMPORARY_TABLESPACE).
Possible solutions:
-------------------
- Manually Coalesce Adjacent Free Extents
ALTER TABLESPACE <tablespace name> COALESCE;
The extents must be adjacent to each other for this to work.
- Add a Datafile:
ALTER TABLESPACE <tablespace name> ADD DATAFILE '<full path and file name>'
SIZE <integer> <k|m>;
- Resize the Datafile:
ALTER DATABASE DATAFILE '<full path and file name>' RESIZE <integer> <k|m>;
- Enable autoextend:
ALTER DATABASE DATAFILE ?<full path and file name>? AUTOEXTEND ON
MAXSIZE UNLIMITED;
- Defragment the Tablespace:
- Lower "next_extent" and/or "pct_increase" size:
ALTER <segment_type> <segment_name> STORAGE ( next <integer> <k|m>
pctincrease <integer>);
- If the tablespace is being used as a temporary tablespace, temporary segments may
be still holding the space.
As far as preventing this error in the future, consider using Oracle SAFE (Simple Algorythm for Fragmentation Elimination)
go to http://otn.oracle.com/ultr
"How to Stop Defragmenting and Start Living"
First:
Run this query (from Metalink) to be sure that the tablespace needs to be defragmented (Use SQL Plus)
select substr(ts.name, 1,10) TableSpace,
to_char(f.file#,990) "file #",
tf.blocks blocks,
sum(f.length) free,
to_char(count(*),9990) frags,
max(f.length) bigst,
to_char(min(f.length),9999
round(avg(f.length)) avg,
to_char(sum(decode(sign(f.
from sys.fet$ f, sys.file$ tf, sys.ts$ ts
where ts.ts# = f.ts#
and ts.ts# = tf.ts#
group by ts.name, f.file#, tf.blocks;
Before you defrag try coalescing free space in the Tablespace
(The extents must be adjacent to each other for this to work) Use sql plus
ALTER tablespace XYZ COALESCE;
To defrag:
(1)export using owner mode, compress = Y.
(2)drop the tablespace.
(3)create the tablespace.
(4)import
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept gsmom94121's comment as answer.
Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Henka
EE Cleanup Volunteer
Business Accounts
Answer for Membership
by: mightycountPosted on 2003-08-14 at 19:56:54ID: 9151858
Try doing
ALTER DATABASE XXX DATAFILE 'filename' AUTOEXTEND ON
helped me awhile back..