今天在执行oracle存储过程的时候报错,错误信息:"01652 无法通过128(在表空间temp中)扩展temp段"。
在linux中执行df命令后发现表空间由于autoextend的原因,导致磁盘已用空间为100%。
[root@localhost ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/sda1 9.5G 8.6G 439M 96% /
/dev/sda3 119G 52G 61G 46% /home/sis
tmpfs 2.0G 0 2.0G 0% /dev/shm
(上面的sd1磁盘可用空间是删除了一些临时文件的显示结果)
解决办法是在另外一个磁盘开辟新的表空间,语句如下:
[root@localhost sis]# mkdir oracle_tmp
[root@localhost sis]# chown -R oracle /home/sis/oracle_tmp
//给EP表空间添加新的dbf文件
[root@localhost sis]# su -l oracle
[oracle@localhost ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Nov 10 11:35:35 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected.
SQL> alter tablespace EP add datafile
2 '/home/sis/oracle_tmp/EP02.dbf' size 500M autoextend on next 100M;
Tablespace altered.
SQL> alter database datafile '/home/oracle/app/oracle/oradata/orcl/EP01.dbf'
2 autoextend off;
Database altered.
新建好的数据文件,貌似oracle会自动随机的写到以后的数据文件中去。
新建临时表空间:
SQL> create temporary tablespace TEMP2 tempfile
2 '/home/sis/oracle_tmp/TEMP2.dbf' size 500m reuse autoextend on next 100m;
Tablespace created.
SQL> alter database default temporary tablespace "TEMP2";
Database altered.