Oracle基础 02 临时表空间 temp

--查看临时文件的使用/剩余空间

SQL> select * from v$temp_space_header;


--查看SCOTT用户所属的临时表空间 

SQL> select username ,temporary_tablespace from dba_users

     where username='SCOTT';  
  

--查看当前有那些临时文件 

SQL> select tablespace_name,file_name,bytes/1024/1024 total_M from dba_temp_files;
    
--重新建立一个临时表空间

SQL> create temporary tablespace temp1 
   tempfile '/u01/app/oracle/oradata/test10g/temp101.dbf' size 100M ;


--添加一个临时表空间文件

SQL> alter tablespace temp add tempfile '/u01/app/oracle/oradata/test10g/temp02.dbf' size 100M;


--将建好的TEMP1表空间设置为数据库默认的临时表空间

SQL> alter database default temporary tablespace temp1;


--DROP掉旧的TEMP的表空间 

SQL> drop tablespace temp including contents and datafiles;

原文地址:https://www.cnblogs.com/john2017/p/6364425.html