分类: Oracle
2017-12-13 12:02:49
01536, 00000, "space quota exceeded for tablespace '%s'"
// *Cause: The space quota for the segment owner in the tablespace has
// been exhausted and the operation attempted the creation of a
// new segment extent in the tablespace.
// *Action: Either drop unnecessary objects in the tablespace to reclaim
// space or have a privileged user increase the quota on this
// tablespace for the segment owner.
DBSVR:
RHEL 5.8 64bit
11.1.0.6.0 64bit
点击(此处)折叠或打开
点击(此处)折叠或打开
SYS@db11g> select * from dba_ts_quotas where username = 'QUOTATEST';
no rows selected
SYS@db11g> select * from dba_sys_privs where grantee = 'QUOTATEST';
no rows selected
SYS@db11g> select * from dba_role_privs where grantee = 'QUOTATEST';
no rows selected
点击(此处)折叠或打开
SYS@db11g> grant connect to quotatest;
Grant succeeded.
SYS@db11g> select * from dba_ts_quotas where username = 'QUOTATEST';
no rows selected
SYS@db11g> select * from dba_sys_privs where grantee = 'QUOTATEST';
no rows selected
SYS@db11g> select * from dba_role_privs where grantee = 'QUOTATEST';
GRANTEE GRANTED_ROLE ADM DEF
------------------------------ ------------------------------ --- ---
QUOTATEST CONNECT NO YES
点击(此处)折叠或打开
QUOTATEST@db11g> select * from user_ts_quotas;
no rows selected
QUOTATEST@db11g> select * from user_sys_privs;
no rows selected
QUOTATEST@db11g> select * from user_role_privs;
USERNAME GRANTED_ROLE ADM DEF OS_
------------------------------ ------------------------------ --- --- ---
QUOTATEST CONNECT NO YES NO
点击(此处)折叠或打开
SYS@db11g> grant resource to quotatest;
Grant succeeded.
SYS@db11g> select * from dba_ts_quotas where username = 'QUOTATEST';
no rows selected
SYS@db11g> select * from dba_sys_privs where grantee = 'QUOTATEST';
GRANTEE PRIVILEGE ADM
------------------------------ ---------------------------------------- ---
QUOTATEST UNLIMITED TABLESPACE NO
SYS@db11g> select * from dba_role_privs where grantee = 'QUOTATEST';
GRANTEE GRANTED_ROLE ADM DEF
------------------------------ ------------------------------ --- ---
QUOTATEST RESOURCE NO YES
QUOTATEST CONNECT NO YES
点击(此处)折叠或打开
QUOTATEST@db11g> select * from user_ts_quotas;
no rows selected
QUOTATEST@db11g> select * from user_sys_privs;
USERNAME PRIVILEGE ADM
------------------------------ ---------------------------------------- ---
QUOTATEST UNLIMITED TABLESPACE NO
QUOTATEST@db11g> select * from user_role_privs;
USERNAME GRANTED_ROLE ADM DEF OS_
------------------------------ ------------------------------ --- --- ---
QUOTATEST CONNECT NO YES NO
QUOTATEST RESOURCE NO YES NO
点击(此处)折叠或打开
QUOTATEST@db11g> create table t1 as select * from all_objects;
Table created.
QUOTATEST@db11g> select * from user_ts_quotas;
TABLESPACE_NAME BYTES MAX_BYTES BLOCKS MAX_BLOCKS DRO
------------------------------ ---------- ---------- ---------- ---------- ---
QUOTATEST 7340032 0 896 0 NO
QUOTATEST@db11g> select * from user_sys_privs;
USERNAME PRIVILEGE ADM
------------------------------ ---------------------------------------- ---
QUOTATEST UNLIMITED TABLESPACE NO
QUOTATEST@db11g> select * from user_role_privs;
USERNAME GRANTED_ROLE ADM DEF OS_
------------------------------ ------------------------------ --- --- ---
QUOTATEST CONNECT NO YES NO
QUOTATEST RESOURCE NO YES NO
点击(此处)折叠或打开
SYS@db11g> select * from dba_ts_quotas where username = 'QUOTATEST';
no rows selected
SYS@db11g> select * from dba_sys_privs where grantee = 'QUOTATEST';
GRANTEE PRIVILEGE ADM
------------------------------ ---------------------------------------- ---
QUOTATEST UNLIMITED TABLESPACE NO
SYS@db11g> select * from dba_role_privs where grantee = 'QUOTATEST';
GRANTEE GRANTED_ROLE ADM DEF
------------------------------ ------------------------------ --- ---
QUOTATEST RESOURCE NO YES
QUOTATEST CONNECT NO YES
点击(此处)折叠或打开
SYS@db11g> alter user quotatest quota 0 on quotatest;
User altered.
SYS@db11g> select * from dba_ts_quotas where username = 'QUOTATEST';
no rows selected
SYS@db11g> select * from dba_sys_privs where grantee = 'QUOTATEST';
GRANTEE PRIVILEGE ADM
------------------------------ ---------------------------------------- ---
QUOTATEST UNLIMITED TABLESPACE NO
SYS@db11g> select * from dba_role_privs where grantee = 'QUOTATEST';
GRANTEE GRANTED_ROLE ADM DEF
------------------------------ ------------------------------ --- ---
QUOTATEST RESOURCE NO YES
QUOTATEST CONNECT NO YES
点击(此处)折叠或打开
QUOTATEST@db11g> select * from user_ts_quotas;
TABLESPACE_NAME BYTES MAX_BYTES BLOCKS MAX_BLOCKS DRO
------------------------------ ---------- ---------- ---------- ---------- ---
QUOTATEST 7340032 0 896 0 NO
QUOTATEST@db11g> select * from user_sys_privs;
USERNAME PRIVILEGE ADM
------------------------------ ---------------------------------------- ---
QUOTATEST UNLIMITED TABLESPACE NO
QUOTATEST@db11g> select * from user_role_privs;
USERNAME GRANTED_ROLE ADM DEF OS_
------------------------------ ------------------------------ --- --- ---
QUOTATEST CONNECT NO YES NO
QUOTATEST RESOURCE NO YES NO
点击(此处)折叠或打开
QUOTATEST@db11g> create table t2 as select * from all_objects;
Table created.
QUOTATEST@db11g> select * from user_ts_quotas;
TABLESPACE_NAME BYTES MAX_BYTES BLOCKS MAX_BLOCKS DRO
------------------------------ ---------- ---------- ---------- ---------- ---
QUOTATEST 14680064 0 1792 0 NO
QUOTATEST@db11g> select * from user_sys_privs;
USERNAME PRIVILEGE ADM
------------------------------ ---------------------------------------- ---
QUOTATEST UNLIMITED TABLESPACE NO
QUOTATEST@db11g> select * from user_role_privs;
USERNAME GRANTED_ROLE ADM DEF OS_
------------------------------ ------------------------------ --- --- ---
QUOTATEST CONNECT NO YES NO
QUOTATEST RESOURCE NO YES NO
点击(此处)折叠或打开
SYS@db11g> select * from dba_ts_quotas where username = 'QUOTATEST';
no rows selected
SYS@db11g> select * from dba_sys_privs where grantee = 'QUOTATEST';
GRANTEE PRIVILEGE ADM
------------------------------ ---------------------------------------- ---
QUOTATEST UNLIMITED TABLESPACE NO
SYS@db11g> select * from dba_role_privs where grantee = 'QUOTATEST';
GRANTEE GRANTED_ROLE ADM DEF
------------------------------ ------------------------------ --- ---
QUOTATEST RESOURCE NO YES
QUOTATEST CONNECT NO YES
点击(此处)折叠或打开
SYS@db11g> revoke unlimited tablespace from quotatest;
Revoke succeeded.
SYS@db11g> select * from dba_ts_quotas where username = 'QUOTATEST';
no rows selected
SYS@db11g> select * from dba_sys_privs where grantee = 'QUOTATEST';
no rows selected
SYS@db11g> select * from dba_role_privs where grantee = 'QUOTATEST';
GRANTEE GRANTED_ROLE ADM DEF
------------------------------ ------------------------------ --- ---
QUOTATEST RESOURCE NO YES
QUOTATEST CONNECT NO YES
点击(此处)折叠或打开
QUOTATEST@db11g> select * from user_ts_quotas;
TABLESPACE_NAME BYTES MAX_BYTES BLOCKS MAX_BLOCKS DRO
------------------------------ ---------- ---------- ---------- ---------- ---
QUOTATEST 14680064 0 1792 0 NO
QUOTATEST@db11g> select * from user_sys_privs;
no rows selected
QUOTATEST@db11g> select * from user_role_privs;
USERNAME GRANTED_ROLE ADM DEF OS_
------------------------------ ------------------------------ --- --- ---
QUOTATEST CONNECT NO YES NO
QUOTATEST RESOURCE NO YES NO
点击(此处)折叠或打开
QUOTATEST@db11g> create table t3 as select * from all_objects;
create table t3 as select * from all_objects
*
ERROR at line 1:
ORA-01536: space quota exceeded for tablespace 'QUOTATEST'
此时quota起作用了,报1536错
QUOTATEST@db11g> select * from user_ts_quotas;
TABLESPACE_NAME BYTES MAX_BYTES BLOCKS MAX_BLOCKS DRO
------------------------------ ---------- ---------- ---------- ---------- ---
QUOTATEST 14680064 0 1792 0 NO
QUOTATEST@db11g> select * from user_sys_privs;
no rows selected
QUOTATEST@db11g> select * from user_role_privs;
USERNAME GRANTED_ROLE ADM DEF OS_
------------------------------ ------------------------------ --- --- ---
QUOTATEST CONNECT NO YES NO
QUOTATEST RESOURCE NO YES NO
点击(此处)折叠或打开
SYS@db11g> select * from dba_ts_quotas where username = 'QUOTATEST';
no rows selected
SYS@db11g> select * from dba_sys_privs where grantee = 'QUOTATEST';
no rows selected
SYS@db11g> select * from dba_role_privs where grantee = 'QUOTATEST';
GRANTEE GRANTED_ROLE ADM DEF
------------------------------ ------------------------------ --- ---
QUOTATEST RESOURCE NO YES
QUOTATEST CONNECT NO YES
点击(此处)折叠或打开
SYS@db11g> alter user quotatest quota -1 on quotatest;
alter user quotatest quota -1 on quotatest
*
ERROR at line 1:
ORA-02187: invalid quota specification
点击(此处)折叠或打开
SYS@db11g> alter user quotatest quota 20m on quotatest;
User altered.
SYS@db11g> select * from dba_ts_quotas where username = 'QUOTATEST';
TABLESPACE_NAME USERNAME BYTES MAX_BYTES BLOCKS MAX_BLOCKS DRO
------------------------------ ------------------------------ ---------- ---------- ---------- ---------- ---
QUOTATEST QUOTATEST 14680064 20971520 1792 2560 NO
SYS@db11g> select * from dba_sys_privs where grantee = 'QUOTATEST';
no rows selected
SYS@db11g> select * from dba_role_privs where grantee = 'QUOTATEST';
GRANTEE GRANTED_ROLE ADM DEF
------------------------------ ------------------------------ --- ---
QUOTATEST RESOURCE NO YES
QUOTATEST CONNECT NO YES
点击(此处)折叠或打开
QUOTATEST@db11g> select * from user_ts_quotas;
TABLESPACE_NAME BYTES MAX_BYTES BLOCKS MAX_BLOCKS DRO
------------------------------ ---------- ---------- ---------- ---------- ---
QUOTATEST 14680064 20971520 1792 2560 NO
QUOTATEST@db11g> select * from user_sys_privs;
no rows selected
QUOTATEST@db11g> select * from user_role_privs;
USERNAME GRANTED_ROLE ADM DEF OS_
------------------------------ ------------------------------ --- --- ---
QUOTATEST CONNECT NO YES NO
QUOTATEST RESOURCE NO YES NO
点击(此处)折叠或打开
QUOTATEST@db11g> create table t4 as select * from all_objects;
create table t4 as select * from all_objects
*
ERROR at line 1:
ORA-01536: space quota exceeded for tablespace 'QUOTATEST'
QUOTATEST@db11g> select * from user_ts_quotas;
TABLESPACE_NAME BYTES MAX_BYTES BLOCKS MAX_BLOCKS DRO
------------------------------ ---------- ---------- ---------- ---------- ---
QUOTATEST 14680064 20971520 1792 2560 NO
QUOTATEST@db11g> select * from user_sys_privs;
no rows selected
QUOTATEST@db11g> select * from user_role_privs;
USERNAME GRANTED_ROLE ADM DEF OS_
------------------------------ ------------------------------ --- --- ---
QUOTATEST CONNECT NO YES NO
QUOTATEST RESOURCE NO YES NO
点击(此处)折叠或打开
SYS@db11g> select * from dba_ts_quotas where username = 'QUOTATEST';
TABLESPACE_NAME USERNAME BYTES MAX_BYTES BLOCKS MAX_BLOCKS DRO
------------------------------ ------------------------------ ---------- ---------- ---------- ---------- ---
QUOTATEST QUOTATEST 14680064 20971520 1792 2560 NO
SYS@db11g> select * from dba_sys_privs where grantee = 'QUOTATEST';
no rows selected
SYS@db11g> select * from dba_role_privs where grantee = 'QUOTATEST';
GRANTEE GRANTED_ROLE ADM DEF
------------------------------ ------------------------------ --- ---
QUOTATEST RESOURCE NO YES
QUOTATEST CONNECT NO YES
点击(此处)折叠或打开
SYS@db11g> alter user quotatest quota unlimited on quotatest;
User altered.
SYS@db11g> select * from dba_ts_quotas where username = 'QUOTATEST';
TABLESPACE_NAME USERNAME BYTES MAX_BYTES BLOCKS MAX_BLOCKS DRO
------------------------------ ------------------------------ ---------- ---------- ---------- ---------- ---
QUOTATEST QUOTATEST 14680064 -1 1792 -1 NO
SYS@db11g> select * from dba_sys_privs where grantee = 'QUOTATEST';
no rows selected
SYS@db11g> select * from dba_role_privs where grantee = 'QUOTATEST';
GRANTEE GRANTED_ROLE ADM DEF
------------------------------ ------------------------------ --- ---
QUOTATEST RESOURCE NO YES
QUOTATEST CONNECT NO YES
点击(此处)折叠或打开
QUOTATEST@db11g> select * from user_ts_quotas;
TABLESPACE_NAME BYTES MAX_BYTES BLOCKS MAX_BLOCKS DRO
------------------------------ ---------- ---------- ---------- ---------- ---
QUOTATEST 14680064 -1 1792 -1 NO
QUOTATEST@db11g> select * from user_sys_privs;
no rows selected
QUOTATEST@db11g> select * from user_role_privs;
USERNAME GRANTED_ROLE ADM DEF OS_
------------------------------ ------------------------------ --- --- ---
QUOTATEST CONNECT NO YES NO
QUOTATEST RESOURCE NO YES NO
点击(此处)折叠或打开
QUOTATEST@db11g> create table t5 as select * from all_objects;
Table created.
QUOTATEST@db11g> select * from user_ts_quotas;
TABLESPACE_NAME BYTES MAX_BYTES BLOCKS MAX_BLOCKS DRO
------------------------------ ---------- ---------- ---------- ---------- ---
QUOTATEST 22020096 -1 2688 -1 NO
QUOTATEST@db11g> select * from user_sys_privs;
no rows selected
QUOTATEST@db11g> select * from user_role_privs;
USERNAME GRANTED_ROLE ADM DEF OS_
------------------------------ ------------------------------ --- --- ---
QUOTATEST CONNECT NO YES NO
QUOTATEST RESOURCE NO YES NO
点击(此处)折叠或打开
SYS@db11g> select * from dba_ts_quotas where username = 'QUOTATEST';
TABLESPACE_NAME USERNAME BYTES MAX_BYTES BLOCKS MAX_BLOCKS DRO
------------------------------ ------------------------------ ---------- ---------- ---------- ---------- ---
QUOTATEST QUOTATEST 22020096 -1 2688 -1 NO
SYS@db11g> select * from dba_sys_privs where grantee = 'QUOTATEST';
no rows selected
SYS@db11g> select * from dba_role_privs where grantee = 'QUOTATEST';
GRANTEE GRANTED_ROLE ADM DEF
------------------------------ ------------------------------ --- ---
QUOTATEST RESOURCE NO YES
QUOTATEST CONNECT NO YES
点击(此处)折叠或打开
User dropped.
SYS@db11g>
Tablespace dropped.
SYS@db11g> SYS@db11g> select * from dba_ts_quotas where username = 'QUOTATEST';
no rows selected
SYS@db11g> select * from dba_sys_privs where grantee = 'QUOTATEST';
no rows selected
SYS@db11g> select * from dba_role_privs where grantee = 'QUOTATEST';
no rows selected