Please see the following statements. My question is, the table t1 was created in the users tablespace, so it will take up some space. But why it can be created before I impose the quota on the users tablespace?


sys@ORCL>create user a identified by a account unlock;

User created.

sys@ORCL>create table a.t1(c int);

Table created.

sys@ORCL>select owner, table_name, tablespace_name from dba_tables where table_name = 'T1';

OWNER                  TABLE_NAME             TABLESPACE_NAME
------------------------------ ------------------------------ ------------------------------
A                  T1                 USERS

sys@ORCL>insert into a.t1 values(1);
insert into a.t1 values(1)
ERROR at line 1:
ORA-01950: no privileges on tablespace 'USERS'

sys@ORCL>alter user a quota 10M on users;

User altered.

sys@ORCL>insert into a.t1 values(1);

1 row created.


Commit complete.


BTW, I've tested using the user a to create the table before the user was imposed the quota. (Suppose the user has create session and create table privilege) The table still can be created. But in my example I'm creating the table using SYS user.


This is the version information:

sys@ORCL>select * from v$version;

Oracle Database 11g Enterprise Edition Release - 64bit Production
PL/SQL Release - Production
CORE  Production
TNS for Linux: Version - Production
NLSRTL Version - Production

  • Because you are logged in as sys? Commented Oct 25, 2011 at 19:03
  • No Jack. I've tested using the user a itself, it still can create the table. But I'm not posted the commands. Commented Oct 25, 2011 at 19:08
  • interesting, I get ORA-01950: no privileges on tablespace 'USERS' until I set the quota Commented Oct 25, 2011 at 19:33
  • please post your version and preferably the exact actual commands you are running Commented Oct 25, 2011 at 19:36
  • I've added the version information. Yes I've posted the exact commands that's I'm executed. I copied them directly from sqlplus. Commented Oct 25, 2011 at 19:56

1 Answer 1


Because of deferred segment creation.

In Oracle 11.2, when you create a table with no data, you no longer allocate any space in the tablespace. Oracle doesn't actually create the segment until you try to insert data into the table. This is a difference from earlier versions in which the segment was created when the table was created rather than when data was inserted.

The reason for the new feature is that there are a lot of packaged applications on the market that create potentially hundreds of tables that will never have data because the customer isn't using some specific module of the project that uses those tables. It was annoying for someone that packaged a big ERP tool, for example, to end up with potentially GB of space allocated to tables that would never have any data.

You'll only see deferred segment creation if you've set COMPATIBLE to 11.2 and if DEFERRED_SEGMENT_CREATION is set to the default of TRUE

SQL> conn / as sysdba
SQL> show parameter compatible

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string
SQL> show parameter deferred

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
deferred_segment_creation            boolean     TRUE
SQL> create user deferred identified by deferred default tablespace users;

User created.

SQL> crant create table, create session to deferred;
SP2-0734: unknown command beginning "crant crea..." - rest of line ignored.
SQL> grant create table, create session to deferred;

Grant succeeded.

SQL> conn deferred/deferred
SQL> create table test( col1 number );

Table created.

SQL> insert into test values( 1 );
insert into test values( 1 )
ERROR at line 1:
ORA-01950: no privileges on tablespace 'USERS'
  • Interesting - but then why is it not the same for me on 11.2 too? Can you check you can reproduce Yousui's test? Commented Oct 25, 2011 at 20:15
  • 1
    @JackDouglas - What are your COMPATIBLE and DEFERRED_SEGMENT_CREATION parameters set to? Commented Oct 25, 2011 at 20:21
  • compatible = '' - well done :) Commented Oct 25, 2011 at 20:24
  • 1
    I guess some of the docs need updating, eg "You must assign Nick a tablespace quota on his default tablespace before he can create objects in that tablespace" Commented Oct 25, 2011 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.