为了防止临时表空间无限制的增加,我采用隔一段时间就重建临时表空间的方法,为了方便,我保留两组语句,轮流执行即可,假定现在临时表空间名称是temp,新建一个tempa表空间,删除temp表空间,方法如下:
create temporary tablespace TEMPA TEMPFILE '/opt/app/oracle/oradata/orcl/tempa01.dbf ' SIZE 8192M REUSE AUTOEXTEND ON NEXT 1024K MAXSIZE UNLIMITED; --创建中转临时表空间
alter database default temporary tablespace tempa; --改变缺省临时表空间
drop tablespace temp including contents and datafiles; --删除原来临时表空间
create temporary tablespace TEMPA TEMPFILE '/opt/app/oracle/oradata/orcl/tempa01.dbf ' SIZE 8192M REUSE AUTOEXTEND ON NEXT 1024K MAXSIZE UNLIMITED; --创建中转临时表空间
alter database default temporary tablespace tempa; --改变缺省临时表空间
drop tablespace temp including contents and datafiles; --删除原来临时表空间