删除临时表空间没有危险!!这个我做过你得先建立另外的临时表空间TEMP2,然后把系统的临时表空间指向他TEMP2然后删除现在的TEMP就可以释放20几G的空间了

解决方案 »

  1.   

    具体方法  1先建立个临时表空间,  create temporary tablespace temp2 tempfile './temp2.dbf' size 1mextent management local uniform size 1m;2把系统默认临时表空间给TEMP2ALTER  DATABASE DAFAULT TEMPORARY TABLESPACE TEMP2;3删除原来临时表空间  drop tablespace temp including contents and datafiles;
      

  2.   

    我先试试,谢谢楼上二位兄弟, 对了飘,问个题外话,size 1m够不够用啊?还有tempfile './temp2.dbf' 中的./是不是表示在当前路径下?
      

  3.   

    可以建立新的datafile在其他目录.
      

  4.   

    tempfile './temp2.dbf' 你也可以写全路径的,也可以添加reuse autoextend on
    比如:
    create temporary tablespace tempbak
    tempfile '****\tempbak.dbf' size 100M reuse autoextend on
    extent management local uniform size 1M;
      

  5.   

    alter database default temporary tablespace tempbak;
    desc v$tempfile;
    select name,file# from v$tempfile;
    把你前边的TEMPFILE先offline比较保险~
    alter database tempfile 2 offline;
      

  6.   

    谢谢楼上各位问题已经解决了,我是这样做的:
    1、  --启动数据库
    sqlplus /nolog
    conn sys/pwd@ora92 as sysdba
    startup
    2、--创建中转临时表空间
    create temporary tablespace  TEMP2 TEMPFILE '/export/home/oracle/oradata/ora92/temp02.dbf' SIZE 512M REUSE AUTOEXTEND ON NEXT  640K MAXSIZE UNLIMITED;
    3、--改变系统默认临时表空间 为刚刚创建的新临时表空间temp2
    alter database default  temporary tablespace  temp2;
    4、--删除原来临时表空间temp
    drop tablespace temp including contents and datafiles;
    5、--重新创建临时表空间temp
    create temporary tablespace  TEMP TEMPFILE '/export/home/oracle/oradata/ora92/temp01.dbf' SIZE 512M REUSE AUTOEXTEND ON NEXT  640K MAXSIZE UNLIMITED;
    6、 --重置系统默认临时表空间
    alter database default  temporary tablespace  temp; 
    7、--删除中转临时表空间temp2
    drop tablespace temp2 including contents and datafiles;