减少临时表使用空间的几种方法
文章作者 100test 发表时间 2007:03:14 13:49:24
来源 100Test.Com百考试题网
1、 第一种方式,直接resize tempfile , 虽然简单,但是很容易无效
sys@mescp> 0select tablespace_name,file_name ,2 file_id,bytes/1024/1024 as "size(M)"3 from dba_temp_files4 /TABLESPACE_NAME FILE_NAME FILE_ID size(M)-------------------- ---------------------------------- ---------- ----------TEMP /orabin/oradata/mescp/temp01.dbf 1 1024TEMP /orabin/oradata/mescp/tmp1_01.dbf 2 40962 rows 0selected.sys@mescp> alter database tempfile 1 resize 16M.alter database tempfile 1 resize 16M*ERROR at line 1:ORA-03297: file contains used data beyond requested RESIZE value-- 失败了
2、第二种,建立另一个临时表空间,并把它设为default temporary tablespace,再删除原来的temporary tablespace以及tempfile。
需要切换,复杂了点……
3、我提供的方式
sys@mescp> alter database tempfile 1 0drop .Database altered.sys@mescp> alter tablespace temp add tempfile2