环境: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 :描述当前用户表空间的限额。