 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.