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
When an INSERT or UPDATE needs more room for a table, Oracle allocates a new extent in the table's tablespace. If there is no free space and the datafile cannot grow, the statement fails with ORA-01653. In 23ai the message names the tablespace, the size it tried to add and the table: unable to increase tablespace LAB_DATA by 1MB during insert or update on table LAB_A.SALES_HIST. Older versions say unable to extend table LAB_A.SALES_HIST by 128 in tablespace LAB_DATA.
The first thing to check is the datafiles of the tablespace in the message: their size, whether autoextensible is YES, and maxbytes. In the lab the tablespace was made 1–5 MB on purpose. If the table itself is mostly empty after a DELETE, also compare its segment size in user_segments with its row count.
01The datafile has a fixed size and autoextend is off
LAB_DATA had one 2 MB datafile. dba_data_files showed AUTOEXTENSIBLE = NO, and dba_free_space showed 0 MB free, so the 20,000-row INSERT had nowhere to go.
ALTER DATABASE DATAFILE '.../lab_data01.dbf' RESIZE 20M made the file bigger, and the same INSERT then finished with 20000 rows created.
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 2M REUSE AUTOEXTEND OFF;
ALTER USER lab_a QUOTA UNLIMITED ON lab_data;Tablespace dropped.
Tablespace created.
User altered.CREATE TABLE sales_hist (sale_id NUMBER, note VARCHAR2(200)) TABLESPACE lab_data;Table created.INSERT INTO sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000;INSERT INTO sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000
*
ERROR at line 1:
ORA-01653: unable to increase tablespace LAB_DATA by 1MB during insert or update on table LAB_A.SALES_HIST
Help: https://docs.oracle.com/error-help/db/ora-01653/COLUMN file_name FORMAT A50
SELECT file_name, bytes/1024/1024 AS size_mb, autoextensible FROM dba_data_files WHERE tablespace_name = 'LAB_DATA';
SELECT NVL(SUM(bytes), 0)/1024/1024 AS free_mb FROM dba_free_space WHERE tablespace_name = 'LAB_DATA';FILE_NAME SIZE_MB AUT
-------------------------------------------------- ---------- ---
/opt/oracle/oradata/FREE/FREEPDB1/lab_data01.dbf 2 NO
1 row selected.
FREE_MB
----------
0
1 row selected.The only data file is 2 MB with AUTOEXTENSIBLE = NO, and FREE_MB is 0. The tablespace is full and cannot grow on its own.
ALTER DATABASE DATAFILE '/opt/oracle/oradata/FREE/FREEPDB1/lab_data01.dbf' RESIZE 20M;Database altered.RESIZE adds a fixed amount once. If the table keeps growing you will hit the same error again later.
INSERT INTO sales_hist SELECT level, RPAD('x', 200, 'x') 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 already reached MAXSIZE
This time the datafile was created with AUTOEXTEND ON NEXT 1M MAXSIZE 3M. After the failure, dba_data_files showed SIZE_MB 3, AUTOEXTENSIBLE YES, MAX_MB 3. Autoextend being YES does not help once the file is at its maximum.
ALTER DATABASE DATAFILE '.../lab_data01.dbf' AUTOEXTEND ON NEXT 1M MAXSIZE 50M raised the limit, and the INSERT then created all 20,000 rows.
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 1M REUSE AUTOEXTEND ON NEXT 1M MAXSIZE 3M;
ALTER USER lab_a QUOTA UNLIMITED ON lab_data;Tablespace dropped.
Tablespace created.
User altered.CREATE TABLE sales_hist (sale_id NUMBER, note VARCHAR2(200)) TABLESPACE lab_data;Table created.INSERT INTO sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000;INSERT INTO sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000
*
ERROR at line 1:
ORA-01653: unable to increase tablespace LAB_DATA by 1MB during insert or update on table LAB_A.SALES_HIST
Help: https://docs.oracle.com/error-help/db/ora-01653/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_DATA';FILE_NAME SIZE_MB AUT MAX_MB
-------------------------------------------------- ---------- --- ----------
/opt/oracle/oradata/FREE/FREEPDB1/lab_data01.dbf 3 YES 3
1 row selected.AUTOEXTENSIBLE is YES, but SIZE_MB and MAX_MB are both 3. The file has already grown to its maximum size.
ALTER DATABASE DATAFILE '/opt/oracle/oradata/FREE/FREEPDB1/lab_data01.dbf' AUTOEXTEND ON NEXT 1M MAXSIZE 50M;Database altered.When you see autoextend YES and still get ORA-01653, compare the current size with maxbytes.
INSERT INTO sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000;
COMMIT;
SELECT COUNT(*) FROM sales_hist;20000 rows created.
Commit complete.
COUNT(*)
----------
20000
1 row selected.03Another table in the same tablespace (a log table) used up the space
orders and app_log share the 5 MB LAB_DATA tablespace (autoextend off). After 12,000 debug log rows had piled up, inserting 8,000 rows into orders failed with ORA-01653.
The message names LAB_A.ORDERS, but orders is not the problem. Segment sizes in the tablespace show APP_LOG at 3072 KB, ORDERS at 1024 KB, and FREE_KB at 0. The table in the message is just the one that asked for the next extent.
The logs were not needed, so TRUNCATE TABLE app_log emptied it and the same INSERT finished with 8000 rows created.
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 5M REUSE AUTOEXTEND OFF;
ALTER USER lab_a QUOTA UNLIMITED ON lab_data;Tablespace dropped.
Tablespace created.
User altered.CREATE TABLE orders (order_id NUMBER, note VARCHAR2(200)) TABLESPACE lab_data;
CREATE TABLE app_log (log_id NUMBER, msg VARCHAR2(200)) TABLESPACE lab_data;
INSERT INTO orders VALUES (0, 'first order');
INSERT INTO app_log SELECT level, RPAD('debug log', 200, 'x') FROM dual CONNECT BY level <= 12000;
COMMIT;Table created.
Table created.
1 row created.
12000 rows created.
Commit complete.INSERT INTO orders SELECT level, RPAD('order', 200, 'x') FROM dual CONNECT BY level <= 8000;INSERT INTO orders SELECT level, RPAD('order', 200, 'x') FROM dual CONNECT BY level <= 8000
*
ERROR at line 1:
ORA-01653: unable to increase tablespace LAB_DATA by 1MB during insert or update on table LAB_A.ORDERS
Help: https://docs.oracle.com/error-help/db/ora-01653/COLUMN segment_name FORMAT A15
SELECT segment_name, SUM(bytes)/1024 AS used_kb FROM dba_segments WHERE tablespace_name = 'LAB_DATA' GROUP BY segment_name ORDER BY used_kb DESC;
SELECT NVL(SUM(bytes), 0)/1024 AS free_kb FROM dba_free_space WHERE tablespace_name = 'LAB_DATA';SEGMENT_NAME USED_KB
--------------- ----------
APP_LOG 3072
ORDERS 1024
2 rows selected.
FREE_KB
----------
0
1 row selected.Summing dba_segments per segment shows APP_LOG as the largest at 3072 KB, and FREE_KB is 0. The space is held by the log table, not by ORDERS from the message.
TRUNCATE TABLE app_log;Table truncated.DELETE does not give space back to the tablespace (see the DELETE cause below). Use TRUNCATE only when the whole log can go; if you must keep it, grow the data file instead.
INSERT INTO orders SELECT level, RPAD('order', 200, 'x') FROM dual CONNECT BY level <= 8000;
COMMIT;
SELECT COUNT(*) FROM orders;8000 rows created.
Commit complete.
COUNT(*)
----------
8001
1 row selected.04Rows were deleted, but a direct-path (APPEND) insert does not reuse that space
A batch loaded 7,000 rows into daily_load in a 3 MB tablespace, then emptied it with DELETE and loaded again with INSERT /*+ APPEND */. The reload failed with unable to increase tablespace LAB_DATA by 64KB, even though the table had no rows.
COUNT(*) was 0, but user_segments still showed the table using 2048 KB. DELETE frees space inside the table's blocks but keeps them; a direct-path insert writes only above the high-water mark, so it needed new space the tablespace did not have. After TRUNCATE TABLE daily_load the segment dropped to 64 KB and the same APPEND insert created all 7,000 rows.
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 3M REUSE AUTOEXTEND OFF;
ALTER USER lab_a QUOTA UNLIMITED ON lab_data;Tablespace dropped.
Tablespace created.
User altered.CREATE TABLE daily_load (sale_id NUMBER, note VARCHAR2(200)) TABLESPACE lab_data;
INSERT /*+ APPEND */ INTO daily_load SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 7000;
COMMIT;
DELETE FROM daily_load;
COMMIT;Table created.
7000 rows created.
Commit complete.
7000 rows deleted.
Commit complete.INSERT /*+ APPEND */ INTO daily_load SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 7000;INSERT /*+ APPEND */ INTO daily_load SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 7000
*
ERROR at line 1:
ORA-01653: unable to increase tablespace LAB_DATA by 64KB during insert or update on table LAB_A.DAILY_LOAD
Help: https://docs.oracle.com/error-help/db/ora-01653/COLUMN segment_name FORMAT A15
SELECT COUNT(*) AS row_count FROM daily_load;
SELECT segment_name, bytes/1024 AS used_kb FROM user_segments WHERE segment_name = 'DAILY_LOAD'; ROW_COUNT
----------
0
1 row selected.
SEGMENT_NAME USED_KB
--------------- ----------
DAILY_LOAD 2048
1 row selected.ROW_COUNT is 0, yet USED_KB is still 2048. The DELETE emptied the rows but the table kept its space.
COLUMN segment_name FORMAT A15
TRUNCATE TABLE daily_load;
SELECT segment_name, bytes/1024 AS used_kb FROM user_segments WHERE segment_name = 'DAILY_LOAD';Table truncated.
SEGMENT_NAME USED_KB
--------------- ----------
DAILY_LOAD 64
1 row selected.For a full reload, use TRUNCATE instead of DELETE. A normal INSERT without APPEND would also reuse the deleted space.
INSERT /*+ APPEND */ INTO daily_load SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 7000;
COMMIT;
SELECT COUNT(*) FROM daily_load;7000 rows created.
Commit complete.
COUNT(*)
----------
7000
1 row selected.05UNIFORM extent size: the file still looks 1MB short of full, but that leftover can never hold an extent
This time the tablespace was created with EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M on a 3MB file with autoextend off. Every new extent of every table must be exactly 1MB, which is why the message says by 1MB.
The file is 3072KB, but user_bytes is only 2048KB: part of the file is header, and the remainder is smaller than one 1MB extent, so it can never be used. Segments already took 2048KB and dba_free_space reports 0. A check that just subtracts used space from file size would say about 1MB is free.
ALTER TABLESPACE lab_data ADD DATAFILE '.../lab_data02.dbf' SIZE 10M added a second file, and the same INSERT finished with 20000 rows created.
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 3M REUSE AUTOEXTEND OFF EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;
ALTER USER lab_a QUOTA UNLIMITED ON lab_data;Tablespace dropped.
Tablespace created.
User altered.CREATE TABLE sales_hist (sale_id NUMBER, note VARCHAR2(200)) TABLESPACE lab_data;Table created.INSERT INTO sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000;INSERT INTO sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000
*
ERROR at line 1:
ORA-01653: unable to increase tablespace LAB_DATA by 1MB during insert or update on table LAB_A.SALES_HIST
Help: https://docs.oracle.com/error-help/db/ora-01653/SELECT allocation_type, next_extent/1024 AS extent_kb FROM dba_tablespaces WHERE tablespace_name = 'LAB_DATA';
SELECT bytes/1024 AS file_kb, user_bytes/1024 AS usable_kb FROM dba_data_files WHERE tablespace_name = 'LAB_DATA';
SELECT SUM(bytes)/1024 AS used_kb FROM dba_segments WHERE tablespace_name = 'LAB_DATA';
SELECT NVL(SUM(bytes), 0)/1024 AS free_kb FROM dba_free_space WHERE tablespace_name = 'LAB_DATA';ALLOCATIO EXTENT_KB
--------- ----------
UNIFORM 1024
1 row selected.
FILE_KB USABLE_KB
---------- ----------
3072 2048
1 row selected.
USED_KB
----------
2048
1 row selected.
FREE_KB
----------
0
1 row selected.ALLOCATION_TYPE is UNIFORM with EXTENT_KB 1024, the file is 3072KB but USABLE_KB is 2048KB, and FREE_KB is 0: nothing left that fits a 1MB extent.
ALTER TABLESPACE lab_data ADD DATAFILE '/opt/oracle/oradata/FREE/FREEPDB1/lab_data02.dbf' SIZE 10M REUSE AUTOEXTEND OFF;Tablespace altered.Adding a data file works when you cannot or do not want to resize the existing one. Judge free space by dba_free_space or user_bytes, not by file size minus used.
INSERT INTO sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000;
COMMIT;
SELECT COUNT(*) FROM sales_hist;20000 rows created.
Commit complete.
COUNT(*)
----------
20000
1 row selected.06The table landed in the user’s small default tablespace because the DDL had no TABLESPACE clause
The CREATE TABLE sales_hist script was copied without its TABLESPACE clause, so the table went to the user’s default tablespace LAB_DATA (2 MB, autoextend off) instead of the large LAB_BIG. Loading 20,000 rows failed with ORA-01653 on LAB_DATA.
ALTER TABLE sales_hist MOVE TABLESPACE lab_big moved the table; user_tables then showed LAB_BIG, and the same INSERT finished with 20000 rows created.
Setup
DROP TABLESPACE IF EXISTS lab_data INCLUDING CONTENTS AND DATAFILES;
DROP TABLESPACE IF EXISTS lab_big INCLUDING CONTENTS AND DATAFILES;
CREATE SMALLFILE TABLESPACE lab_data DATAFILE '/opt/oracle/oradata/FREE/FREEPDB1/lab_data01.dbf' SIZE 2M REUSE AUTOEXTEND OFF;
CREATE SMALLFILE TABLESPACE lab_big DATAFILE '/opt/oracle/oradata/FREE/FREEPDB1/lab_big01.dbf' SIZE 20M REUSE AUTOEXTEND OFF;
ALTER USER lab_a DEFAULT TABLESPACE lab_data QUOTA UNLIMITED ON lab_data QUOTA UNLIMITED ON lab_big;Tablespace dropped.
Tablespace dropped.
Tablespace created.
Tablespace created.
User altered.-- table DDL copied without the TABLESPACE clause
CREATE TABLE sales_hist (sale_id NUMBER, note VARCHAR2(200));Table created.INSERT INTO sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000;INSERT INTO sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000
*
ERROR at line 1:
ORA-01653: unable to increase tablespace LAB_DATA by 1MB during insert or update on table LAB_A.SALES_HIST
Help: https://docs.oracle.com/error-help/db/ora-01653/SELECT default_tablespace FROM user_users;
SELECT table_name, tablespace_name FROM user_tables WHERE table_name = 'SALES_HIST';
SELECT tablespace_name, SUM(bytes)/1024/1024 AS free_mb FROM user_free_space WHERE tablespace_name IN ('LAB_DATA', 'LAB_BIG') GROUP BY tablespace_name ORDER BY tablespace_name;DEFAULT_TABLESPACE
------------------------------
LAB_DATA
1 row selected.
TABLE_NAME TABLESPACE_NAME
------------------------------ ------------------------------
SALES_HIST LAB_DATA
1 row selected.
TABLESPACE_NAME FREE_MB
------------------------------ ----------
LAB_BIG 19
1 row selected.DEFAULT_TABLESPACE is LAB_DATA and the table is in LAB_DATA too. In the free-space list only LAB_BIG (19 MB) appears; LAB_DATA has no free space left, so it is not listed at all.
ALTER TABLE sales_hist MOVE TABLESPACE lab_big;
SELECT table_name, tablespace_name FROM user_tables WHERE table_name = 'SALES_HIST';Table altered.
TABLE_NAME TABLESPACE_NAME
------------------------------ ------------------------------
SALES_HIST LAB_BIG
1 row selected.Before adding space, check that the table is in the tablespace you meant.
INSERT INTO sales_hist SELECT level, RPAD('x', 200, 'x') 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-01653 unable to extend table mean?
The table needed more space, and the tablespace named in the message had no free space and could not grow its datafile.
How do I check free space in a tablespace?
SELECT NVL(SUM(bytes), 0)/1024/1024 FROM dba_free_space WHERE tablespace_name = 'X'; for free space, and dba_data_files for each file's size, autoextensible and maxbytes.
Autoextend is YES, so why do I still get ORA-01653?
The datafile can only grow up to MAXSIZE. In the lab the file was 3 MB with MAXSIZE 3 MB; raising MAXSIZE to 50 MB fixed it.
Is ORA-01653 the same as ORA-01652?
No. ORA-01653 is about a permanent table's tablespace. ORA-01652 is about temporary space used by sorts and temporary tables.
The table in the ORA-01653 message is small — who is using the space?
The message only names the table that asked for the next extent. In the lab it said LAB_A.ORDERS, but dba_segments showed APP_LOG holding 3072 KB of the tablespace. Truncating the log table fixed it.
Why ORA-01653 when the table is empty after DELETE?
DELETE keeps the blocks, and INSERT /*+ APPEND */ writes only above them. In the lab the empty table still used 2048 KB; after TRUNCATE it was 64 KB and the APPEND insert worked.
Why ORA-01653 when the data file is not full yet?
With UNIFORM SIZE 1M, leftover space smaller than 1MB can never be used. In the lab the file was 3072KB but user_bytes was 2048KB and dba_free_space was 0. Adding a data file fixed it.
Why ORA-01653 on a tablespace I never chose for that table?
If CREATE TABLE has no TABLESPACE clause, the table goes to the user’s default tablespace. Compare user_users.default_tablespace with user_tables.tablespace_name. In the test, moving the table with ALTER TABLE ... MOVE TABLESPACE to the large tablespace fixed the load.
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