How to Drop Corrupted Undo Tablespace Segments in Oracle
If undo segments in the undo tablespace (like UNDOTBS1) become corrupted, their status appears as NEEDS RECOVERY. These segments can't be dropped directly unless taken offline first.
Step 1: Check for Corrupted Segments
Run this query to find the corrupted undo segments:
Step 2: Generate the Offline Segment Parameter
To take these segments offline, generate the following parameter setting using this query:
This will output a statement like:
Copy and run that output as SYSDBA.
Step 3: Restart the Database
Since the parameter was set in the SPFILE, restart the database to apply the change:
Step 4: Drop the Corrupted Rollback Segments
Now that the segments are offline, you can drop them. Generate the necessary SQL with this:
Then execute the generated DROP ROLLBACK SEGMENT statements one by one.
Optional: Drop the Undo Tablespace
If you're no longer using UNDOTBS1 and have already switched to a new undo tablespace, you can drop it:
Make sure the undo retention period has passed and no active session is using it.

Post a Comment
Post a Comment