ORA-01536错误导致数据无法插入

[问题描述]

[17:18:34]Error:   occur a SQLError, errcode = 1536, errdesc = ORA-01536: 超出表空间 'SCUDATATBS' 的空间限额

[17:18:34]Error:   Multiple sql statements executed failed. sqlErrorNo=-1536

 

1536 Error means

ORA 1536 space quota exceeded for tables This exception occurs when the maximum space allocated for a table is reached and the attempt to allocate more space fails. There may be a dependency object on this table. Insert on this object may need to update the dependant object, which really exhausted the quota. But the error will be reported generally.

 

知识总结:
表空间的大小与用户的配额大小是两种不同的概念,表空间的大小是指实际的用户表空间的大小,而配额大小指的是用户指定使用表空间的的大小。把表空间文件增大,还是出现这个问题,用户在使用表空间的同时使用空间的限额,如果超出限制,就算有空的地方,也不会让用户使用

 

从日志看描述:SCUDATATBS 表空间上无法分配空间,不同通过下面查询表空间大小的SQL的执行结果看,还有30G空余;为什么空间就无法分配了呢?

应该是创建用户时,指定了空间限额,导致限额用完,然后报:ORA-01536 错误:

 

视图:
1.dba_ts_quotas : DBA_TS_QUOTAS describes tablespace quotas for all users.
2.user_ts_quotas : USER_TS_QUOTAS describes tablespace quotas for the current user. This view does not display the USERNAME column.


查看用户的表空间的限额

SQL>select * from dba_ts_quotas;
max_bytes 字段就是了。-1是代表没有限制,其它值多少就是多少了.

 

用户表空间限额的创建与更改:

1.创建用户时,指定限额

CREATE USER SKATE IDENTIFIED BY SKATE_PWD
DEFAULT TABLESPACE SKATE_TS
TEMPORARY TABLESPACE temp
QUOTA 3M ON SKATE_TS
PASSWORD EXPIRE;

 

【处理方法】

修改空间限额:

SQL>GRANT UNLIMITED TABLESPACE TO username;   --修改为系统级无限制;

一般情况,不用下面两个SQL,写出来做一个知识积累;

SQL>alter user username quota unlimited on TABLESPACENAME;  --修改用户级为无限制;
SQL>alter user username quota 200M on TABLESPACENAME;     --修改用户级为200M;

 回收权限

SQL>revoke unlimited tablespace from skate;
SQL>alter user usernamequota 0 on TABLESPCANAME;

 

posted @ 2017-03-15 14:47  当年亦如是  阅读(521)  评论(0)    收藏  举报