1、问题现象:
vasportal_20130111061515020_run.log:27:[2013-01-11 06:15:13:127][error][312]add contact group error,[
vasportal_20130111061515020_run.log:29:### Error updating database. Cause: java.sql.SQLException: ORA-01688: unable to extend table SA03.T_CONTACT_GROUP partition P_CONTACT_GROUP_002 by 128 in tablespace TS_APP_DATA_03
vasportal_20130111061515020_run.log:31:### The error may involve contactGroup.addContactGroup-Inline
vasportal_20130111061515020_run.log:32:### The error occurred while setting parameters
2、问题原因:
(1) ORA-01688: unable to extend table ,这个错误表明表空间已使用完,且无法分配新的空间。这是因为表空间扩展方式为手动模式,而非自动模式;
3、解决法:
(1)、确定是哪个表空间用满了(查看表空间利用率):
SELECT c.ts#, c.name, d.contents, d.extent_management, e.file_bytes, c.used,
SUBSTR (c.used / e.file_bytes * 100, 1, 5)
FROM (SELECT name, ts#, SUM(used) used
FROM (SELECT a.allocated_space * (SELECT value -- 查询db_block_size当前值
FROM v$parameter
WHERE name = 'db_block_size') / 1024/ 1024 used,
b.ts#, b.name
FROM v$filespace_usage a, v$tablespace b
WHERE a.tablespace_id = b.ts#)
GROUP BY name, ts#) c,
dba_tablespaces d,
(SELECT ts#, SUM(bytes) / 1024/ 1024 file_bytes
FROM v$datafile
GROUP BY ts#) e
WHERE c.name = d.tablespace_name
AND e.ts# = c.ts#
ORDER BY ts#
结果:
(2)现在要扩展表空间:TS_APP_DATA_03,先确定表空间文件:
SELECT FILE#, NAME FROM V$DATAFILE
结果:
(3)更新数据表空间文件大小:
ALTER DATABASE DATAFILE 9 RESIZE 4G;
说明:此处的 ‘9’是上面查出的FILE# = 9的空间;4G是重新分配的空间大小;
(4)更新结果: