linux下oracle表空间导致磁盘空间不足
上一篇 /
下一篇 2012-04-19 11:18:07
/ 个人分类:linux
今天在执行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;
查看dbafile如下:
SELECT tablespace_name,file_id,file_name,round(bytes / (1024 * 1024), 0) total_space FROM dba_data_files ORDER BY tablespace_name;
收藏
举报
TAG: