temporary tablespace是oracle里临时表空间,临时表空间主要用途是在数据库进行排序运算、管理索引、访问视图等操作时提供临时的运算空间,当运算完成之后系统会自动清理。当oracle里需要用到sort的时候,而pga又没有足够大的时候,将会把数据放入临时表空间里进行排序,同时如果有异常情况的话,也会被放入临时表空间,但是我们需要重建temporary tablespace,直接是不能drop默认的临时表空间的,不过我们可以通过以下方法来做。
查看目前的temporary tablespace
SQL> select name from v$tempfile;
NAME
———————————————————————
/opt/oracle/oradata/conner/temp02.dbf
/opt/oracle/oradata/conner/temp03.dbf
SQL> select username,temporary_tablespace from dba_users;
USERNAME TEMPORARY_TABLESPACE
—————————— ——————————
SYS TEMP
SYSTEM TEMP
TEST TEMP
新建temporary
SQL>create temporary tablespace temp2 datafile ‘/opt/oracle/oradata/ORCL/temp02.dbf’ size 50M autoextend on next 10M maxsize unlimited
切换默认temporary tablespace
SQL>alter database default temporary tablespace temp2;
SQL> select username,temporary_tablespace from dba_users;
USERNAME TEMPORARY_TABLESPACE
—————————— ——————————
SYS TEMP2
SYSTEM TEMP2
TEST TEMP2
drop掉以前的temporary tablespace
SQL>drop tablespace temp2 including contents and datafiles;
===============================================================
Inthirties关注Oracle数据库 维护,优化,安全,备份,恢复,迁移,故障处理
如果你需要帮助或想和我一起学习的请联系
联系方式QQ:370140387
QQ群: 85837884(注明:数据库)
电子邮件:dba@Inthirties.com
网站: http://www.inthirties.com