Chinaunix首页 | 论坛 | 博客
  • 博客访问: 763280
  • 博文数量: 99
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1163
  • 用 户 组: 普通用户
  • 注册时间: 2016-09-22 09:50
个人简介

一个守望数据库的老菜鸟

文章分类

全部博文(99)

文章存档

2019年(21)

2018年(17)

2017年(37)

2016年(24)

我的朋友

分类: Oracle

2017-10-02 19:16:27

博客文章除注明转载外,均为原创。转载请注明出处。
本文链接地址:http://blog.chinaunix.net/uid-31396856-id-5772866.html
ORA-01536 space quota exceeded for tablespace '%s'
超出了表空间users的空间配额限量

[oracle@oraserv ~]$ oerr ora 01536
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.


Solution:
=================
select owner, tablespace_name, table_name
    from dba_tables
 where tablespace_name = '';

先查看用户的表空间的限额

select * from dba_ts_quotas;
select * from user_ts_quotas;

max_bytes字段-1是代表没有限制,其它值多少就是多少. 

dba_ts_quotas :描述所有用户表空间的限额
user_ts_quotas :描述当前用户表空间的限额。

如果查询结果中max_bytes字段不为-1,修改为无限制或者指定的大小。因此解决方法如下:
1) 增加配额:
alter user quota on

2) 赋予unlimited配额:
不对用户做表空间限额控制:
    GRANT UNLIMITED TABLESPACE TO ;
这种方式是全局性的。  
或者
    alter user  quota unlimited on  ;
 这种方式是针对特定的表空间的.

回收表空间限额控制:
    revoke unlimited tablespace from  ;
或者
    alter user  quota 0 on  ;

如果还不能解决问题,需要注意当前用户的角色。
当给用户授权RESOURCE或DBA角色时,Oracle会顺便将UNLIMED TABLESPACE权限授权给用户,一旦回收其中任意一个角色,会同时将该权限收回。

记得曾经有一个案例:
一个线上数据库报这个错误,是因为dba先进行了grant dba,然后又revoke dba,按理说revoke dba后其他已经赋予用户的权限都应该还在。
通过查询:
select* from dba_sys_privs where grantee='';
grant resource to ;

但事实上回收revoke dba后发现只少了"UNLIMITED TABLESPACE"权限,问题就是出在这里!revoke dba后应再赋予一次resource角色。
---The end
阅读(949) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~