PROBLEM:

While dropping a tempfile got the below error.

SQL> alter tablespace TEMP drop tempfile ‘/archive/NONPLUG/NONCDB/temp01.dbf’;
alter tablespace TEMP drop tempfile ‘/archive/NONPLUG/NONCDB/temp01.dbf’
*
ERROR at line 1:

ORA-25152: TEMPFILE cannot be dropped at this time

Solution:

If we try to drop a tempfile, while active sessions are still using that particular tempfile, then this error hits.  So the solution is to kill those sessions.

Check the session using temp:

output

Kill the above sessions:

Now drop the temp again: