当前位置:操作系统 > Unix/Linux >>

一次临时表空间用满问题

一次临时表空间用满问题
 
背景:
在我们公司,有一个专门的演示环境,在做售前的时候可以用上面的系统向客户做演示。
 
问题:
  今天,我们经理在向客户演示的时候,系统突然报:ORA-01652: unable to extend temp segment by 128 in tablespace TEMP ORA-06512: at "BEMS.PKG_RPT_180101", line 12 ORA-06512: at line 1 
 
分析:
  从网上百度一下,或者查看一下ORACLE的联机帮助文档,很容易知道这是临时表空间不足了。所以我们赶紧查看一下临时表空间情况:
  1.查看表空间情况
  SQL> select file_name,bytes/1024/1024 "MB",autoextensible,tablespace_name from dba_temp_files  ;
  从查询结果知道当前只有一个临时表空间,虽能是自增长的,但是已经32G了,已经达到了max size。问题已经很清楚了,考虑到正在给客户演示,要赶紧让系统恢复正常。
  
解决方案:
1.创建一个新的临时表空间
SQL> create temporary tablespace temp02 tempfile '/home/oracle/oradata/bemsdemo/temp03.dbf' size 512M; 
2.把当前的默认表空间切换到新建的表空间上
SQL> alter database default temporary tablespace temp02;
3.删除原来的临时表空间
SQL> drop tablespace temp including contents and datafiles;
4.重新创建原来的临时表空间
SQL> create temporary tablespace temp tempfile '/home/oracle/oradata/bemsdemo/temp01.dbf' size 512M autoextend on maxsize 32G;
5.把默认临时表空间切换回来
SQL> alter database default temporary tablespace temp;
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,