Oracle Solution for Error ora-01640

Solution for Oracle Error ORA-01640

ORA-01640: cannot make tablespace read only with active transactions

What triggered the Error:

Attempting to make a tablespace read only while there are active transactions in the database. All transactions must commit or rollback to insure that there is no undo for a tablespace before it can be made read only. This includes in doubt distributed transactions.

What should we do to fix it:

Prevent any more transactions from being started. Putting the database in restricted mode usually helps. If there are any in doubt transactions they must also be resolved.