We were trying to drop the temporary Tablespace to free some space on one of the mount point. We have created another TEMP tablespace and make its as a default TEMP tablespace.
When we issue command for dropping TEMP TS its hanging:
SQL> drop tablespace TEMP including contents and datafiles;
Hanging
Cause:
The current acctive session are using the block from the previous table space and hence its unable to proceed with the DROP statement.
SQL> select count(1) from v$sort_usage; COUNT(1) ---------- 21
SQL> select USERNAME, TS# TABLESPACE, SQL_ID from v$sort_usage; USERNAME TS# TABLESPACE SQL_ID ------------------------------ ---------- ------------------------------ ------------- XMETA 3 TEMP 3hkjq203y2wth XMETA 3 TEMP 7x520x1zf28y6 XMETA 3 TEMP 3hkjq203y2wth XMETA 3 TEMP 5d0ymkhc1f6qb XMETA 3 TEMP 5d0ymkhc1f6qb XMETA 3 TEMP 3hkjq203y2wth XMETA 3 TEMP 3hkjq203y2wth XMETA 3 TEMP 3hkjq203y2wth XMETA 3 TEMP 3hkjq203y2wth XMETA 3 TEMP 7x520x1zf28y6 XMETA 3 TEMP 5d0ymkhc1f6qb USERNAME TS# TABLESPACE SQL_ID ------------------------------ ---------- ------------------------------ ------------- XMETA 3 TEMP 3hkjq203y2wth XMETA 3 TEMP 3hkjq203y2wth XMETA 3 TEMP 3hkjq203y2wth XMETA 3 TEMP 3hkjq203y2wth XMETA 3 TEMP 5d0ymkhc1f6qb XMETA 3 TEMP 7x520x1zf28y6 XMETA 3 TEMP bz7kpsapkc870 DSODB 3 TEMP dv7xcynf4yy74 DSODB 3 TEMP 60vb41snxxabf
Solution:
- Kill all session occupied in the old temporary tablespace and then try to drop it.
- If its a TEST/DEV DB and downtime is possible you can even restart the Instance.