ITPub博客

首页 > Linux操作系统 > Linux操作系统 > ORA-01536: 超出表空间 'USERS' 的空间限额

ORA-01536: 超出表空间 'USERS' 的空间限额

原创 Linux操作系统 作者:sea_wl 时间:2011-09-11 13:36:55 0 删除 编辑
 

Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0

Connected as SYS

 

SQL> conn mytest/mytest@orcl;

Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0

Connected as mytest

 

SQL> create table t_clob(column1 clob,column2 number(18));

 

create table t_clob(column1 clob,column2 number(18))

 

ORA-01536: 超出表空间 'USERS' 的空间限额

 

/*注释:查看一下当前用户mytest对users表空间的使用配额是多少*/

SQL> select * from user_ts_quotas;

 

TABLESPACE_NAME                     BYTES  MAX_BYTES     BLOCKS MAX_BLOCKS DROPPED

------------------------------ ---------- ---------- ---------- ---------- -------

USERS                               65536          0          8          0 NO

 

/*注释:太奇怪了,竟然是0

    分配指定配额给mytest用户。

*/

SQL> alter user mytest quota 50m on users;

 

alter user mytest quota 50m on users

 

ORA-01031: 权限不足

 

/*注释:权限不足,切换到sys用户下*/

SQL> conn sys / as sysdba;

Not logged on

 

SQL> conn sys/ as sysdba;

Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0

Connected as SYS

 

SQL> alter user mytest quota 50m on users;

 

User altered

 

SQL> select * from user_ts_quotas;

 

TABLESPACE_NAME                     BYTES  MAX_BYTES     BLOCKS MAX_BLOCKS DROPPED

------------------------------ ---------- ---------- ---------- ---------- -------

 

/*注释:切换回mytest用户*/

SQL> conn mytest/mytest;

Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0

Connected as mytest

 

/*注释:查看一下当前用户mytest对users表空间的使用配额是多少*/

SQL> select * from user_ts_quotas;

 

TABLESPACE_NAME                     BYTES  MAX_BYTES     BLOCKS MAX_BLOCKS DROPPED

------------------------------ ---------- ---------- ---------- ---------- -------

USERS                               65536   52428800          8       6400 NO

 

/*注释:已经有50m的使用权,继续建表*/

SQL> create table t_clob(column1 clob,column2 number(18));

 

Table created

 

/*注释:创建成功*/

SQL> desc t_clob;

Name    Type       Nullable Default Comments

------- ---------- -------- ------- --------

COLUMN1 CLOB       Y                        

COLUMN2 NUMBER(18) Y  

 

/*注释:查看一下users表空间大小*/

SQL> select round(max_extents/1024/1024/1024,2) || 'G' from user_tablespaces where tablespace_name = 'USERS';

 

ROUND(MAX_EXTENTS/1024/1024/10

-----------------------------------------

2G

 

/*注释:竟然有2G,那为什么会报上面的错误,ORA-01536: 超出表空间 'USERS' 的空间限额?

*/

/*分析:oracle的表空间与表空间限额是两个不同的值,用户默认分配到一定限额的使用权,超过限额就会报错,需要指定用户限额为某一个值,也可以无限制。*/

 

SQL> conn sys/ as sysdba;

Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0

Connected as SYS

 

SQL> alter user mytest quota unlimited on users;

 

User altered

 

SQL> conn mytest/mytest;

Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0

Connected as mytest

 

SQL> select * from user_ts_quotas;

 

TABLESPACE_NAME                     BYTES  MAX_BYTES     BLOCKS MAX_BLOCKS DROPPED

------------------------------ ---------- ---------- ---------- ---------- -------

USERS                              262144         -1         32         -1 NO

 

 

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/18998060/viewspace-707182/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 开篇~信手涂鸦
请登录后发表评论 登录
全部评论

注册时间:2010-09-19

  • 博文量
    3
  • 访问量
    4766