Oracle 23.26SpaceLab-verified · 2026-11-17

ORA-01536: space quota exceeded for tablespace

The table's owner used up the space quota it has on the tablespace that holds the table.

Oracle AI Database 26ai Free 23.26.3.0.0
ORA-01536: space quota exceeded for tablespace 'USERS'

Jump to a cause

  1. 01The user's quota on the tablespace is too small
  2. 02Another user inserts, but the quota that counts is the table owner's
  3. 03The table is in a different tablespace from the user's default

Lab-verifiedReproduced and fixed on Oracle AI Database 26ai Free 23.26.3.0.0 · 2026-11-17 · container image gvenzl/oracle-free:23-slim

A user can only use as much space in a tablespace as its quota allows (ALTER USER ... QUOTA). When a table grows past its owner's quota, the statement fails with ORA-01536, even if the tablespace itself still has plenty of free space. The message names the tablespace: space quota exceeded for tablespace 'USERS'.

Check three things: which tablespace is in the message, who owns the table, and that owner's quota (user_ts_quotas, dba_ts_quotas). In the lab each case inserted 20,000 rows of about 200 bytes against a 1 MB quota.

01The user's quota on the tablespace is too small

LAB_A had QUOTA 1M ON users. The 20,000-row INSERT failed, and user_ts_quotas showed USERS, used 1 MB, quota 1 MB: the quota was full.

As a DBA, ALTER USER lab_a QUOTA 50M ON users; raised the quota, and the same INSERT created 20,000 rows.

Setup
Setuprun as system
ALTER USER lab_a QUOTA 1M ON users;
OUTPUT
User altered.
Setuprun as lab_a
CREATE TABLE sales_hist (sale_id NUMBER, note VARCHAR2(200));
OUTPUT
Table created.
Reproducerun as lab_a
INSERT INTO sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000;
✕ ERROR
INSERT INTO sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000
            *
ERROR at line 1:
ORA-01536: space quota exceeded for tablespace 'USERS'
Help: https://docs.oracle.com/error-help/db/ora-01536/
Checkrun as lab_a
SELECT tablespace_name, bytes/1024/1024 AS used_mb, DECODE(max_bytes, -1, 'UNLIMITED', max_bytes/1024/1024 || ' MB') AS quota FROM user_ts_quotas;
OUTPUT
TABLESPACE_NAME                   USED_MB QUOTA
------------------------------ ---------- -------------------------------------------
USERS                                   1 1 MB

1 row selected.
Fixrun as system
ALTER USER lab_a QUOTA 50M ON users;
OUTPUT
User altered.

Quota is changed by a DBA (or a user with ALTER USER). The user cannot raise it alone.

After the fixrun as lab_a
INSERT INTO sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000;
COMMIT;
SELECT COUNT(*) FROM sales_hist;
✓ SUCCESS
20000 rows created.


Commit complete.


  COUNT(*)
----------
     20000

1 row selected.

02Another user inserts, but the quota that counts is the table owner's

LAB_B inserted into lab_a.sales_hist and got ORA-01536. dba_ts_quotas showed LAB_B with UNLIMITED on USERS, but LAB_A, the table owner, with 1 MB. Segment space belongs to the table owner, so the inserting user's quota does not matter.

Raising the owner's quota with ALTER USER lab_a QUOTA 50M ON users; let LAB_B's same INSERT create 20,000 rows. LAB_B's quota was not changed.

Setup
Setuprun as system
ALTER USER lab_a QUOTA 1M ON users;
OUTPUT
User altered.
Setuprun as lab_a
CREATE TABLE sales_hist (sale_id NUMBER, note VARCHAR2(200));
GRANT INSERT, SELECT ON sales_hist TO lab_b;
OUTPUT
Table created.


Grant succeeded.
Reproducerun as lab_b
INSERT INTO lab_a.sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000;
✕ ERROR
INSERT INTO lab_a.sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000
                  *
ERROR at line 1:
ORA-01536: space quota exceeded for tablespace 'USERS'
Help: https://docs.oracle.com/error-help/db/ora-01536/
Checkrun as system
SELECT username, tablespace_name, DECODE(max_bytes, -1, 'UNLIMITED', max_bytes/1024/1024 || ' MB') AS quota FROM dba_ts_quotas WHERE username IN ('LAB_A', 'LAB_B') ORDER BY username;
OUTPUT
USERNAME                       TABLESPACE_NAME                QUOTA
------------------------------ ------------------------------ -------------------------------------------
LAB_A                          USERS                          1 MB
LAB_B                          USERS                          UNLIMITED

2 rows selected.
Fixrun as system
ALTER USER lab_a QUOTA 50M ON users;
OUTPUT
User altered.

If an application account gets ORA-01536 on another schema's table, look at the owner's quota, not the application account's.

After the fixrun as lab_b
INSERT INTO lab_a.sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000;
COMMIT;
SELECT COUNT(*) FROM lab_a.sales_hist;
✓ SUCCESS
20000 rows created.


Commit complete.


  COUNT(*)
----------
     20000

1 row selected.

03The table is in a different tablespace from the user's default

The message said 'LAB_DATA', not USERS. user_tables showed SALES_HIST stored in LAB_DATA, and user_ts_quotas showed LAB_DATA 1 MB while USERS was UNLIMITED. Having an unlimited quota on the default tablespace did not help, because the table was created with TABLESPACE lab_data.

ALTER USER lab_a QUOTA UNLIMITED ON lab_data; fixed it, and the INSERT created 20,000 rows.

Setup
Setuprun as system
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 20M REUSE;
ALTER USER lab_a QUOTA 1M ON lab_data;
OUTPUT
Tablespace dropped.


Tablespace created.


User altered.
Setuprun as lab_a
CREATE TABLE sales_hist (sale_id NUMBER, note VARCHAR2(200)) TABLESPACE lab_data;
OUTPUT
Table created.
Reproducerun as lab_a
INSERT INTO sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000;
✕ ERROR
INSERT INTO sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000
            *
ERROR at line 1:
ORA-01536: space quota exceeded for tablespace 'LAB_DATA'
Help: https://docs.oracle.com/error-help/db/ora-01536/
Checkrun as lab_a
SELECT table_name, tablespace_name FROM user_tables WHERE table_name = 'SALES_HIST';
SELECT tablespace_name, DECODE(max_bytes, -1, 'UNLIMITED', max_bytes/1024/1024 || ' MB') AS quota FROM user_ts_quotas ORDER BY tablespace_name;
OUTPUT
TABLE_NAME                     TABLESPACE_NAME
------------------------------ ------------------------------
SALES_HIST                     LAB_DATA

1 row selected.


TABLESPACE_NAME                QUOTA
------------------------------ -------------------------------------------
LAB_DATA                       1 MB
USERS                          UNLIMITED

2 rows selected.
Fixrun as system
ALTER USER lab_a QUOTA UNLIMITED ON lab_data;
OUTPUT
User altered.

Always read the tablespace name in the message. Quotas are set per tablespace.

After the fixrun as lab_a
INSERT INTO sales_hist SELECT level, RPAD('x', 200, 'x') FROM dual CONNECT BY level <= 20000;
COMMIT;
SELECT COUNT(*) FROM sales_hist;
✓ SUCCESS
20000 rows created.


Commit complete.


  COUNT(*)
----------
     20000

1 row selected.

FAQ

What does ORA-01536 space quota exceeded mean?

The table owner has used all of its quota on the tablespace named in the message. The tablespace may still have free space.

How do I check my tablespace quota?

SELECT tablespace_name, bytes, max_bytes FROM user_ts_quotas; shows your usage and quota per tablespace. A DBA can see everyone in dba_ts_quotas. max_bytes = -1 means UNLIMITED.

How do I fix ORA-01536?

Have a DBA raise the table owner's quota on that tablespace, for example ALTER USER lab_a QUOTA 50M ON users; or QUOTA UNLIMITED ON lab_data.

I have UNLIMITED quota, so why do I get ORA-01536?

Either the table belongs to another user whose quota is full, or the table is in a different tablespace from the one you have UNLIMITED on. Both were reproduced in the lab.

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