创建表时空间受限制

环境:oracle10.2.0.1 
SQL>conn appuser/apppasswd
SQL>create table app_bak  as select * from app;
create table 失败,提示错误信息:
ORA-01536 超出表空间‘USERS’的空间限量

问题分析:ORA-01536是指的你建表的那个user所能使用的空间没有了,而不是你要建的那个表所在的tablespace 没有free space 了。你需要

做的是给那个user 对那个tablespace 有更多的space可以使用或是没限制。


解决问题有三种方法:

方法一:SQL> alter user user_name quota unlimited on tablespace_name;

方法二:SQL> alter user user_name quota 100M on tablespace_name;

方法三:SQL> grant unlimited tablespace to user_name;


方法一:

SQL> conn / as sysdba
已连接。
SQL> alter user test quota unlimited on test;

用户已更改。

SQL> conn test/test
已连接。

查看dba_ts_quotas:
SQL> select username,tablespace_name,bytes,max_bytes from dba_ts_quotas where username='TEST';

USERNAME                       TABLESPACE_NAME                   BYTES     MAX_BYTES                                          

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

    TEST                                         TEST                                        131072            -1                                          

                                                                         
或者可用查看user_ts_quotas:

SQL> select * from user_ts_quotas;

TABLESPACE_NAME            BYTES     MAX_BYTES     BLOCKS       MAX_BLOCKS   DRO                                               

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

TEST                                          131072            -1            16                       -1                         NO     

方法二:

SQL> conn / as sysdba
已连接。
SQL> alter user test quota 100M on test;

用户已更改。

SQL> select username,tablespace_name,bytes,max_bytes from dba_ts_quotas where username='TEST';

USERNAME                       TABLESPACE_NAME             BYTES     MAX_BYTES                                          

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

TEST                                    TEST                                         131072        104857600  


方法三:

SQL> conn / as sysdba
已连接。
SQL> grant unlimited tablespace to test;

授权成功。

SQL> select username,tablespace_name,bytes,max_bytes from dba_ts_quotas where username='TEST';

USERNAME                       TABLESPACE_NAME               BYTES        MAX_BYTES                                          

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

TEST                                       TEST                                        131072        104857600   


备注:

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

dba_ts_quotas :描述所有用户表空间的限额

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值