Oracle Solution for Error ora-01682

Solution for Oracle Error ORA-01682

ORA-01682: read-only DB cannot allocate temporary space in tablespace string

What triggered the Error:

Temporary space (usually for sorting) could not be allocated in either main storage or a tempfile. An attempt was made to allocate the space from the tablespace named, but the database is opened read-only. The database open requires a sort work space.

What should we do to fix it:

Either allow sufficient workspace in main storage (SORT_AREA_SIZE initialization parameter), or create a temporary tablespace before making the database read-only. Use ALTER TABLESPACE ADD TEMPFILE statement to add temporary files to the temporary tablespace.