Lab-verifiedReproduced and fixed on Oracle AI Database 26ai Free 23.26.3.0.0 · 2026-12-01 · container image gvenzl/oracle-free:23-slim
ORA-01659 appears when a segment is being created and the tablespace cannot give it all of the space its storage clause asks for. In both runs here the cause was STORAGE (INITIAL 20M) in a 10MB tablespace: unable to allocate MINEXTENTS beyond 1 in tablespace LAB_DATA.
For a table, deferred segment creation lets CREATE TABLE succeed and the error comes on the first INSERT. An index on a table with data gets its segment right away, so CREATE INDEX itself fails.
01Table DDL has STORAGE (INITIAL 20M) and the tablespace is only 10MB
CREATE TABLE order_hist ... STORAGE (INITIAL 20M) in the 10MB LAB_DATA tablespace returned Table created.. The first INSERT then failed with ORA-01659.
ALTER TABLE order_hist MOVE STORAGE (INITIAL 64K); rebuilt it with a small first extent. The INSERT succeeded and user_tables showed INITIAL_KB 64, SEGMENT_CREATED YES.
Setup
DROP TABLESPACE IF EXISTS lab_data INCLUDING CONTENTS AND DATAFILES;
CREATE SMALLFILE TABLESPACE lab_data DATAFILE '/opt/oracle/oradata/FREE/FREEPDB1/lab_data01.dbf' SIZE 10M REUSE AUTOEXTEND OFF;
ALTER USER lab_a QUOTA UNLIMITED ON lab_data;Tablespace dropped.
Tablespace created.
User altered.CREATE TABLE order_hist (
order_id NUMBER PRIMARY KEY,
order_date DATE
) TABLESPACE lab_data
STORAGE (INITIAL 20M);Table created.INSERT INTO order_hist VALUES (1, DATE '2026-12-01');INSERT INTO order_hist VALUES (1, DATE '2026-12-01')
*
ERROR at line 1:
ORA-01659: unable to allocate MINEXTENTS beyond 1 in tablespace LAB_DATA
Help: https://docs.oracle.com/error-help/db/ora-01659/SELECT table_name, initial_extent/1024/1024 AS initial_mb, segment_created FROM dba_tables WHERE owner = 'LAB_A' AND table_name = 'ORDER_HIST';
SELECT bytes/1024/1024 AS file_mb, autoextensible FROM dba_data_files WHERE tablespace_name = 'LAB_DATA';TABLE_NAME INITIAL_MB SEG
------------------------------ ---------- ---
ORDER_HIST 20 NO
1 row selected.
FILE_MB AUT
---------- ---
10 NO
1 row selected.dba_tables shows INITIAL_MB 20 and SEGMENT_CREATED NO, while the only datafile is FILE_MB 10 with AUT NO. The table asks for more than the whole tablespace.
ALTER TABLE order_hist MOVE STORAGE (INITIAL 64K);Table altered.If the 20MB came from copied production DDL, removing or shrinking the STORAGE clause is usually what you want.
INSERT INTO order_hist VALUES (1, DATE '2026-12-01');
COMMIT;
SELECT table_name, initial_extent/1024 AS initial_kb, segment_created FROM user_tables WHERE table_name = 'ORDER_HIST';1 row created.
Commit complete.
TABLE_NAME INITIAL_KB SEG
------------------------------ ---------- ---
ORDER_HIST 64 YES
1 row selected.02CREATE INDEX with STORAGE (INITIAL 20M) on a table that already has rows
The emp table already had 100 rows. CREATE INDEX emp_dept_ix ON emp (dept_id) TABLESPACE lab_data STORAGE (INITIAL 20M); failed immediately with ORA-01659 — no INSERT needed.
After ALTER TABLESPACE lab_data ADD DATAFILE '.../lab_data02.dbf' SIZE 30M; the same CREATE INDEX succeeded and user_segments showed the index at 20MB.
Setup
DROP TABLESPACE IF EXISTS lab_data INCLUDING CONTENTS AND DATAFILES;
CREATE SMALLFILE TABLESPACE lab_data DATAFILE '/opt/oracle/oradata/FREE/FREEPDB1/lab_data01.dbf' SIZE 10M REUSE AUTOEXTEND OFF;
ALTER USER lab_a QUOTA UNLIMITED ON lab_data;Tablespace dropped.
Tablespace created.
User altered.CREATE TABLE emp (emp_id NUMBER, dept_id NUMBER) TABLESPACE lab_data;
INSERT INTO emp SELECT level, MOD(level, 10) FROM dual CONNECT BY level <= 100;
COMMIT;Table created.
100 rows created.
Commit complete.CREATE INDEX emp_dept_ix ON emp (dept_id) TABLESPACE lab_data STORAGE (INITIAL 20M);CREATE INDEX emp_dept_ix ON emp (dept_id) TABLESPACE lab_data STORAGE (INITIAL 20M)
*
ERROR at line 1:
ORA-01659: unable to allocate MINEXTENTS beyond 1 in tablespace LAB_DATA
Help: https://docs.oracle.com/error-help/db/ora-01659/SELECT bytes/1024/1024 AS file_mb, autoextensible FROM dba_data_files WHERE tablespace_name = 'LAB_DATA';
SELECT ROUND(SUM(bytes)/1024/1024, 1) AS free_mb, ROUND(MAX(bytes)/1024/1024, 1) AS largest_free_mb FROM dba_free_space WHERE tablespace_name = 'LAB_DATA'; FILE_MB AUT
---------- ---
10 NO
1 row selected.
FREE_MB LARGEST_FREE_MB
---------- ---------------
8.9 8.9
1 row selected.The datafile is 10MB with AUT NO, and dba_free_space shows FREE_MB 8.9, LARGEST_FREE_MB 8.9 — less than the 20MB the index asks for.
ALTER TABLESPACE lab_data ADD DATAFILE '/opt/oracle/oradata/FREE/FREEPDB1/lab_data02.dbf' SIZE 30M REUSE AUTOEXTEND OFF;Tablespace altered.Here the index really was created at 20MB. If it does not need that much, a smaller INITIAL avoids using the space at all.
CREATE INDEX emp_dept_ix ON emp (dept_id) TABLESPACE lab_data STORAGE (INITIAL 20M);
SELECT segment_name, bytes/1024/1024 AS size_mb FROM user_segments WHERE segment_name = 'EMP_DEPT_IX';Index created.
SEGMENT_NAME SIZE_MB
-------------------------------------------------------------------------------------------------------------------------------- ----------
EMP_DEPT_IX 20
1 row selected.FAQ
What does "MINEXTENTS beyond 1" mean in ORA-01659?
The segment could not get all of the initial space its storage clause requires. In both runs the request was STORAGE (INITIAL 20M) in a 10MB tablespace with autoextend off.
What is the difference between ORA-01659 and ORA-01658?
Both come from a first extent that does not fit. In our runs a table with INITIAL 20M raised ORA-01658 in a 5MB tablespace and ORA-01659 in a 10MB tablespace. The fixes are the same: smaller INITIAL or more space.
How do I fix ORA-01659?
Check initial_extent in dba_tables / user_tables and the space in dba_data_files / dba_free_space. Then shrink INITIAL (ALTER TABLE ... MOVE STORAGE (INITIAL 64K)) or add space (ALTER TABLESPACE ... ADD DATAFILE ... SIZE 30M).
Why did CREATE TABLE succeed but INSERT fail with ORA-01659?
The table had no segment yet (SEGMENT_CREATED NO). The 20MB was requested only when the first row was inserted. An index on a table with data is created with its segment, so the error comes from CREATE INDEX.
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