Skip to Main Content
  • Questions
  • Index cannot extent while tablespace have enough space

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, James.

Asked: August 07, 2000 - 6:12 am UTC

Last updated: November 09, 2022 - 2:40 pm UTC

Version: 7.3.4 for NT

Viewed 10K+ times! This question is

You Asked

I got an error when running a Form.
ORA-01654: unable to extend index
SYSTEM.ARAID_INVOICE_SEQ_ID by 512 in tablespace ar_idx

When I check the database, I found the following

Size Used Free
Tablespace in MG. in MG. in MG.
-------------------- ------ ------ ------ ------ ------
AR_IDX 250 204 (82%) 46 (18%)

INDEX_NAME TABLESPACE INITIAL_EX NEXT_EXT Max Use M-U MAX_SIZE USED_SIZE
------------------------------ ---------- ---------- ---------- ---- ---- ---- ------------ ------------
ARAID_INVOICE_SEQ_ID AR_IDX 15360K 1024K 249 3 246 263.00M 17.01M


Segments that cannot extend
===========================
Seg
OWNER Name Tablespace NEXTEXT LARGEST
--------------- ------------------------------ --------------- --------- ---------
SYSTEM ARID_SALES_RECAP AR_IDX 1054720 819200
SYSTEM ARID_REVENUE_CENTRE 1054720 819200
SYSTEM ARID_CODE_YEAR 1054720 819200
SYSTEM ARID_ACCOUNT_NO 1054720 819200
SYSTEM ARAID_CODE_YEAR 1054720 819200
SYSTEM ARAID_INVOICE_SEQ_ID 1054720 819200
SYSTEM ARAID_SALES_RECAP 1054720 819200
SYSTEM PK_CMSTMP_BATCH 1048576 819200
SYSTEM IDX_ARID_MC 1054720 819200

It seems that there is plenty of space for the indexes. What is the reason for the error?
Best Regards


and Tom said...

Run the free.sql script below, eg:

SQL> @free 1

(that'll sort by tablespace name). It'll show you how much space is ALLOCATED to a tablespace, how much of that is allocated to objects, how much is free and most important for you the largest free contigous extent in that tablespace.

You might have 46meg free but the largest contigous extent might only be 100k.

It is possible that you have lots of free extents that are next to eachother - you can try running "alter tablespace T coalesce" to see if that increases the "largest" column from the following query....

--------------------------------------------------------
-- free.sql
--
-- This SQL Plus script lists freespace by tablespace
--------------------------------------------------------

column dummy noprint
column pct_used format 999.9 heading "%|Used"
column name format a16 heading "Tablespace Name"
column Kbytes format 999,999,999 heading "KBytes"
column used format 999,999,999 heading "Used"
column free format 999,999,999 heading "Free"
column largest format 999,999,999 heading "Largest"
column max_size format 999,999,999 heading "MaxPoss|Kbytes"
column pct_max_used format 999.9 heading "%|Max|Used"
break on report
compute sum of kbytes on report
compute sum of free on report
compute sum of used on report

select nvl(b.tablespace_name,
nvl(a.tablespace_name,'UNKOWN')) name,
kbytes_alloc kbytes,
kbytes_alloc-nvl(kbytes_free,0) used,
nvl(kbytes_free,0) free,
((kbytes_alloc-nvl(kbytes_free,0))/
kbytes_alloc)*100 pct_used,
nvl(largest,0) largest
from ( select sum(bytes)/1024 Kbytes_free,
max(bytes)/1024 largest,
tablespace_name
from sys.dba_free_space
group by tablespace_name ) a,
( select sum(bytes)/1024 Kbytes_alloc,
tablespace_name
from sys.dba_data_files
group by tablespace_name )b
where a.tablespace_name (+) = b.tablespace_name
order by &1
/

Rating

  (6 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

SYSTEM Tablespace hitting same error

Shailesh Saraff, September 07, 2004 - 5:13 am UTC

Hi Tom,

Our customer is on Oracle 8.1.7.4 on HP/UX. Recently we came across following error...

ORA-00604: error occurred at recursive SQL level 1
ORA-01654: unable to extend index SYS.I_COL1 by 13 in tablespace SYSTEM

When we analyzed this, found that SYSTEM tablespace size = maxsize. Then try to check why all of sudden SYSTEM tablespace is full and found that with some bug in an application created 10000 views causing this problem. Application creates view on log on and drops view on exit but some bug prevented it. We droped around 9000 views and then problem was solved.

But when queried DBA_DATA_FILES Bytes, MaxBytes it was same. We queried DBA_Free_Space there was no record for SYSTEM tablespace. To be on safer side added one extra data file for <SYSTEM> tablespace.

For reference below giving you command of SYSTEM tablespace and create view statement.

ALTER DATABASE DATAFILE '%ORACLE_HOME%\oradata\«DB»\System\system01.dat' AUTOEXTEND ON NEXT 10M MAXSIZE 300M;

Application creates following view on logon and drop on exit.

CREATE OR REPLACE VIEW Viw'||SomePassedValue||' AS SELECT F.* FROM TblCase F
WHERE F.CaseId IN ( SELECT F3.CaseId
FROM TBlCase F3 WHERE Nvl(F3.IsLockedFromOE, 'N') = 'N' AND F3.CaseId = F.CaseId
UNION ALL SELECT F1.CaseId
FROM TblCase F1, MainTable1 Q
WHERE F.CaseId = Q.CaseId AND F1.CaseId = F.CaseId
AND F1.IsLockedFromOE = 'J' AND Q.OEContacted In ( Values...) --- Around 400 VALUES
UNION ALL Select Q2.ToCaseId
FROM TblCase F2, MainTable1 Q1, MainTable2 Q2
WHERE F2.CaseId = Q2.ToCaseId AND Q1.CaseId = Q2.FromCaseId AND F2.CaseId = F.CaseId )';

Inour case 10000 views occupy around 200 MB, So we may have redefine MAXSIZE.
What else can be done in such situation?
Why even after dropping views we don't see free space for SYSTEM tablespace?

Please guide us.

Thanks & Regards,

Shailesh




Tom Kyte
September 07, 2004 - 9:15 am UTC

you filled up your system tablespace. I_COL1 is an index on COL$


sys@ORA9IR2> select table_name from user_indexes where index_name = 'I_COL1';

TABLE_NAME
------------------------------
COL$



In fact it is:

I_COL1 Yes OBJ#, NAME


on that table. So, for every view you had (some 9,000 of them) you had multiple entries to make in that index (say each view has 5 columns, say the average length of the name in the index is 10 characters -- that would be about 1/2meg just in NAMES alone -- and that is on the very very very low side)


So, you came in and dropped these views. Space -- once given -- is not "taken away", the index -- I_COL1 cannot "give back space", so dba_free_space would never "grow" because of a delete (it takes a REORG, REBUILD, or in 10g an online segment shrink to give space "back"). However, the index I_COL1 now has lots and lots of free space in it that can be used, albeit only by that index (but that was the index that was having an "issue" so...)



The space is there, it is allocated to the index, it is usable only by the index, it'll never appear in dba_free_space again in this case.


I would ask the developers of this application "what the HECK were you thinking! stop doing this really bad thing!"

but as long as they clean up their garbage, SYSTEM will hit a steady state size. SYSTEM grows as needed, and if you mistakenly leave 10's of thousands of views in there -- well, caveat emptor. We store what we are asked to store. if you drop the views, the space is there, it is available -- it is part of the segment that originally allocated it all.






This is possible for fresh inserts but we experience same in DELETE

Umesh, May 12, 2006 - 9:26 am UTC

Hi Tom,
I am facing a strange problem.
I have a tablespace of size is 100 MB
There is one table in it with a CLOB column in it. The table has occupied size 72 MB for 11000 records.
There is no record of this tablespace in DBA_FREE_SPACE view. Means no free space in this tablspace.
When I try to delete 10000 records from this table ,

operation throws following error :

“ORA-01654: unable to extend index BBLLREL3.SYS_IL0000027644C00002$$ by 8 in
tablespace LLU_XML_DATA”

Can you please suggest what is problem in this?
Why it is trying to extend the index when I am trying to delete the records?

Thanks in advance!

Tom Kyte
May 12, 2006 - 4:13 pm UTC

no one ever said indexes "shrink" during a delete - in fact, it is not unusual for them to grow a bit.

This index must be right on the edge of needing to "grow" and the index maintanence taking place is causing it to do so.

oh! I never thought this.

Umesh, May 15, 2006 - 4:04 am UTC

Tom,
Many Thanks!!
I never thought that index maintenance would require some space with is not available in this case.

Regards,
Umesh

unable to extend index sys.i_col1 by 13 in tablespace SYSTEM

abu, January 25, 2012 - 9:26 pm UTC

AutoPatch error:
The following ORACLE error:

ORA-00604: error occurred at recursive SQL level 1
ORA-01654: unable to extend index SYS.I_COL1 by 13 in tablespace SYSTEM


occurred while executing the SQL statement:

CREATE TABLE ad_util_params( worker_id number not null,
utility_name varchar2(100) not null, task
varchar2(30) not null, status varchar2(100) not null,
arguments varchar2(2000) not null, rowid1
varchar2(2000), utility_status number not null, symbolic_arguments
varchar2(2560) not null)

AutoPatch error:

Error running SQL and EXEC commands in parallel

Freeing includes hash table
Freeing fixes hash table
Freeing basedons hash table
Freeing entities hash table

You should check the file
/d01/prod/apps/apps_st/appl/admin/PROD/log/adpatch.log

for errors.


Tom Kyte
January 26, 2012 - 10:31 am UTC

and? you have a question?

if the question is "what do I do about this", the answer is "add space to system"

this is excellent

abu, January 26, 2012 - 9:44 pm UTC

hi ,
i got autopatch error ....
system tablespace is already defined tablespace.and i got error message is index in system tablespace cann't inserting because of lowsize?

Serhat CELIK, November 09, 2022 - 9:59 am UTC

Hello All.

I tried to collect useful actions, web addresses and notes, which include the problem and the precautions to be taken, at the address below. I hope that will be useful.

Have a great work.

https://serhatcelik.wordpress.com/2022/11/09/how-to-prevent-unable-to-extend-create-errors-in-oracle-database/
Chris Saxon
November 09, 2022 - 2:40 pm UTC

Thanks for putting this together