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;
Tags:
Oracle