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?
Thanks.
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.
sys@ORCL>commit;
Commit complete.
sys@ORCL>
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.
Edit:
This is the version information:
sys@ORCL>select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
sys@ORCL>
sys? – Jack Douglas♦ Oct 25 '11 at 19:03ORA-01950: no privileges on tablespace 'USERS'until I set the quota – Jack Douglas♦ Oct 25 '11 at 19:33