Dropping a tempfile only without dropping the temp tablespace


The datafiles from a tablespace can not be removed until you drop the entire tablespace. However, one can remove a TEMPFILE from a database without dropping the tablespac


SQL> select tablespace_name,file_id,bytes_used,bytes_free from v$temp_space_header;

TABLESPACE_NAME                  FILE_ID BYTES_USED BYTES_FREE
------------------------------ --------- ---------- ----------

TEMP                                        1          2.147E+09                     0

CELLTEMP                                  2          1048576           1.048E+09
Now let us add a tempfile to TEMP tablespace

SQL>alter tablespace temp add tempfile '/temp/temp01.dbf' size 2048M;
Tablespace altered.

 
SQL> alter database tempfile '/temp/temp.dbf' drop including datafiles;
Database altered.
 
 


Post a Comment

And that's all there is to it!

If anyone has any other questions or requests for future How To posts, you can either ask them in the comments or email me. Please don't feel shy at all!

I'm certainly not an expert, but I'll try my hardest to explain what I do know and research what I don't know.

Previous Post Next Post