简单的执行一个建表sql,报错OUT OF SPACE。如下所示:
[dmdba@dm ~]$ cd /home/dmdba/dmdbms/bin
[dmdba@dm bin]$ ./disql test
密码:
服务器[LOCALHOST:5236]:处于普通打开状态
登录使用时间 : 2.206(ms)
disql V8
SQL> create table t1(id int);
[-523]:Out of space.
(1)首先检查数据库服务器是否还有磁盘空间。通过执行df -h检查,检查发现磁盘空间充足。
(2)再检查表空间是否还有空间,可以通过下面的命令进行检查:
SQL1:
SELECT F.TABLESPACE_NAME,
ROUND((T.TOTAL_SPACE - F.FREE_SPACE) / 1024,2) "USED (GB)",
ROUND(F.FREE_SPACE / 1024,2) "FREE (GB)",
ROUND(T.TOTAL_SPACE / 1024,2) "TOTAL (GB)",
(ROUND((F.FREE_SPACE / T.TOTAL_SPACE),4)* 100) || '% ' PER_FREE,
(ROUND((T.TOTAL_SPACE - F.FREE_SPACE) / T.TOTAL_SPACE, 4) * 100)||'%' PER_USED,
T.AUTOEXTENSIBLE
FROM (
SELECT TABLESPACE_NAME,ROUND(SUM(BLOCKS * page/1024/ 1024)) FREE_SPACE
FROM DBA_FREE_SPACE
GROUP BY TABLESPACE_NAME
) F,
( SELECT TABLESPACE_NAME,AUTOEXTENSIBLE, ROUND(SUM(BYTES / 1048576)) TOTAL_SPACE
FROM DBA_DATA_FILES
GROUP BY TABLESPACE_NAME,AUTOEXTENSIBLE
) T
WHERE F.TABLESPACE_NAME = T.TABLESPACE_NAME;
SQL2:
select t2.name,
path,
t1.total_size*page/1024/1024 as total_size,
t1.free_size*page/1024/1024 as free_size,
t1.real_free_size*page/1024/1024 as real_free_size,
t1.max_size,
t1.next_size,
t1.auto_extend
from v$datafile t1,
v$tablespace t2
where t1.group_id=t2.id
order by name;
经过一番检查,也没有发现是表空间不足导致的。
(3)检查是否给用户限制了磁盘配额。通过下面的命令进行检查。
老版本:
select cast(dbms_metadata.get_ddl('USER','TEST') as VARCHAR) from dual; --看创建用户的DDL,有没有DISKSPACE LIMIT,大小是页的个数*page
新版本:
SELECT QUOTAS.TABLESPACE_NAME, QUOTAS.USERNAME, MAX_BYTES FROM DBA_TS_QUOTAS QUOTAS WHERE QUOTAS.USERNAME = 'TEST';
经过以上3步检查后,发现是给用户设置了磁盘限额,才导致OUT OF SPACE。最后取消磁盘限额或放大磁盘限额解决这个问题。
放大磁盘限额:alter user "TEST" diskspace limit 500; --单位是M
取消磁盘限额:alter user "TEST" diskspace UNLIMITED;
文章
阅读量
获赞