Unable to drop temporary tablespace

 To drop the existing temporary tablespace 

  The following procedure to be followed 

  a. create another temporary tablespace in another  drive ( windows ) or filesystem.(linux)

    CREATE TEMPORARY TABLESPACE  TEMP1 TEMPFILE '<PATH>/temp1_01.dbf' size 10g;

  b. Make it default for the database.

    ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP1;

  c. Make sure that no users have the old temp as their default .

 Setting the new temp tablespace to their default temp tablespace by running the "alter user" statement generated from the below Query

 SELECT    'ALTER USER '
       || username
       || ' TEMPORARY TABLESPACE TEMP1;' 
  FROM dba_users
 WHERE temporary_tablespace = 'TEMP'
   AND username NOT IN ('SYSTEM', 'SYS', 'PUBLIC', '_NEXT_USER');

  d. Drop the current temporary tablespace.

    ALTER DATABASE TEMPFILE '<path>/temp1.dbf' DROP INCLUDING DATAFILES;

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