现象:程序运行一段时间后提示异常:ORA-01654: unable to extend index SERVER410.IDX_DATETIME_21 by 8192 in tablespace TABLE
--查询表空间使用情况:
select a.tablespace_name,a.bytes/1024/1024 "sum MB",
(a.bytes-b.bytes)/1024/1024 "used MB",b.bytes/1024/1024 "free MB",
round (((a.bytes-b.bytes)/a.bytes)*100,2) "used%" from
(select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) a,
(select tablespace_name,sum(bytes) bytes,max (bytes) largest from dba_free_space group by tablespace_name)b where a.tablespace_name=b.tablespace_name
order by ((a.bytes-b.bytes)/a.bytes) desc;
查看 TABLE 对应的占用空间,确实没有空间的情况下,可以选择扩容。
--增加表空间数据文件(注意此处的文件名称和路径)
alter tablespace TABLE add datafile 'E:\DATABASE\ERECORDDB1.ORA' size 1000m