Lab-verifiedReproduced and fixed on Oracle AI Database 26ai Free 23.26.3.0.0 · 2026-11-18 · container image gvenzl/oracle-free:23-slim
ORA-01654 is the index version of ORA-01653. When an INSERT or UPDATE adds index entries and the index segment needs to grow, Oracle allocates a new extent in the index's tablespace. If that tablespace is full and cannot grow, the statement fails. The message names the index and the tablespace: unable to extend index LAB_A.SALES_HIST_NOTE_IX by 8 in tablespace LAB_IDX.
The table itself may be in a tablespace with plenty of space. In the lab the table was in USERS and only its index was in a small tablespace LAB_IDX. Each case inserted 20,000 rows with about 190-byte keys.
01The index tablespace's datafile has AUTOEXTEND off
LAB_IDX had one 1 MB datafile with AUTOEXTEND OFF. The 20,000-row INSERT failed with by 8 in tablespace LAB_IDX.
user_indexes showed SALES_HIST_NOTE_IX in LAB_IDX, and dba_data_files showed the file at 1 MB with AUTOEXTENSIBLE NO. After ALTER DATABASE DATAFILE '.../lab_idx01.dbf' AUTOEXTEND ON NEXT 1M MAXSIZE 50M; the same INSERT created 20,000 rows.
Setup
DROP TABLESPACE IF EXISTS lab_idx INCLUDING CONTENTS AND DATAFILES;
CREATE SMALLFILE TABLESPACE lab_idx DATAFILE '/opt/oracle/oradata/FREE/FREEPDB1/lab_idx01.dbf' SIZE 1M REUSE AUTOEXTEND OFF;
ALTER USER lab_a QUOTA UNLIMITED ON lab_idx;Tablespace dropped.
Tablespace created.
User altered.CREATE TABLE sales_hist (sale_id NUMBER, note VARCHAR2(200));
CREATE INDEX sales_hist_note_ix ON sales_hist (note) TABLESPACE lab_idx;Table created.
Index created.INSERT INTO sales_hist SELECT level, RPAD('x', 190, 'x') || level FROM dual CONNECT BY level <= 20000;INSERT INTO sales_hist SELECT level, RPAD('x', 190, 'x') || level FROM dual CONNECT BY level <= 20000
*
ERROR at line 1:
ORA-01654: unable to extend index LAB_A.SALES_HIST_NOTE_IX by 8 in tablespace LAB_IDX
Help: https://docs.oracle.com/error-help/db/ora-01654/SELECT index_name, tablespace_name FROM user_indexes WHERE table_name = 'SALES_HIST';INDEX_NAME TABLESPACE_NAME
------------------------------ ------------------------------
SALES_HIST_NOTE_IX LAB_IDX
1 row selected.COLUMN file_name FORMAT A50
SELECT file_name, bytes/1024/1024 AS size_mb, autoextensible FROM dba_data_files WHERE tablespace_name = 'LAB_IDX';FILE_NAME SIZE_MB AUT
-------------------------------------------------- ---------- ---
/opt/oracle/oradata/FREE/FREEPDB1/lab_idx01.dbf 1 NO
1 row selected.ALTER DATABASE DATAFILE '/opt/oracle/oradata/FREE/FREEPDB1/lab_idx01.dbf' AUTOEXTEND ON NEXT 1M MAXSIZE 50M;Database altered.Start from the tablespace name in the message, not the table's tablespace.
INSERT INTO sales_hist SELECT level, RPAD('x', 190, 'x') || level FROM dual CONNECT BY level <= 20000;
COMMIT;
SELECT COUNT(*) FROM sales_hist;20000 rows created.
Commit complete.
COUNT(*)
----------
20000
1 row selected.02AUTOEXTEND is on, but the datafile reached MAXSIZE
This time the file was AUTOEXTEND ON NEXT 1M MAXSIZE 2M. The INSERT still failed, this time with by 128 in tablespace LAB_IDX.
dba_data_files showed SIZE_MB 2, AUT YES, MAX_MB 2: autoextend was on, but the file was already at its maximum. Raising it with AUTOEXTEND ON NEXT 1M MAXSIZE 50M let the INSERT create 20,000 rows.
Setup
DROP TABLESPACE IF EXISTS lab_idx INCLUDING CONTENTS AND DATAFILES;
CREATE SMALLFILE TABLESPACE lab_idx DATAFILE '/opt/oracle/oradata/FREE/FREEPDB1/lab_idx01.dbf' SIZE 1M REUSE AUTOEXTEND ON NEXT 1M MAXSIZE 2M;
ALTER USER lab_a QUOTA UNLIMITED ON lab_idx;Tablespace dropped.
Tablespace created.
User altered.CREATE TABLE sales_hist (sale_id NUMBER, note VARCHAR2(200));
CREATE INDEX sales_hist_note_ix ON sales_hist (note) TABLESPACE lab_idx;Table created.
Index created.INSERT INTO sales_hist SELECT level, RPAD('x', 190, 'x') || level FROM dual CONNECT BY level <= 20000;INSERT INTO sales_hist SELECT level, RPAD('x', 190, 'x') || level FROM dual CONNECT BY level <= 20000
*
ERROR at line 1:
ORA-01654: unable to extend index LAB_A.SALES_HIST_NOTE_IX by 128 in tablespace LAB_IDX
Help: https://docs.oracle.com/error-help/db/ora-01654/COLUMN file_name FORMAT A50
SELECT file_name, bytes/1024/1024 AS size_mb, autoextensible, maxbytes/1024/1024 AS max_mb FROM dba_data_files WHERE tablespace_name = 'LAB_IDX';FILE_NAME SIZE_MB AUT MAX_MB
-------------------------------------------------- ---------- --- ----------
/opt/oracle/oradata/FREE/FREEPDB1/lab_idx01.dbf 2 YES 2
1 row selected.ALTER DATABASE DATAFILE '/opt/oracle/oradata/FREE/FREEPDB1/lab_idx01.dbf' AUTOEXTEND ON NEXT 1M MAXSIZE 50M;Database altered.AUTOEXTENSIBLE = YES alone does not mean there is room. Compare the size with MAXBYTES.
INSERT INTO sales_hist SELECT level, RPAD('x', 190, 'x') || level FROM dual CONNECT BY level <= 20000;
COMMIT;
SELECT COUNT(*) FROM sales_hist;20000 rows created.
Commit complete.
COUNT(*)
----------
20000
1 row selected.FAQ
What does ORA-01654 unable to extend index mean?
The index named in the message needed more space, and the tablespace in the message could not provide it. The number after by is the extent size in blocks it tried to get.
How do I check the index tablespace size?
Find the tablespace in user_indexes (or the message), then SELECT file_name, bytes, autoextensible, maxbytes FROM dba_data_files WHERE tablespace_name = 'LAB_IDX';.
How do I fix ORA-01654?
Give the index tablespace room. In the lab, ALTER DATABASE DATAFILE '...' AUTOEXTEND ON NEXT 1M MAXSIZE 50M; fixed both the AUTOEXTEND OFF case and the MAXSIZE case.
What is the difference between ORA-01653 and ORA-01654?
ORA-01653 is raised when a table segment cannot grow, ORA-01654 when an index segment cannot grow. When indexes are in their own tablespace, you can get ORA-01654 while the table's tablespace still has space.
How we verify
Each scenario starts from fresh database users. A script runs the setup, confirms the exact error code, applies the fix and runs the statement again. The output shown is what the database printed, saved by the script.
lab_a and lab_b are ordinary users created for the test; system is the DBA account. Oracle AI Database 26ai Free Release 23.26.3.0.0 - Develop, Learn, and Run for Free 23.26.3.0.0