失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > Linux表空间扩容 linux下oracle表空间导致磁盘空间不足

Linux表空间扩容 linux下oracle表空间导致磁盘空间不足

时间:2019-11-03 23:28:38

相关推荐

Linux表空间扩容 linux下oracle表空间导致磁盘空间不足

今天在执行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

Copyright (c) 1982, , 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.

如果觉得《Linux表空间扩容 linux下oracle表空间导致磁盘空间不足》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。