Informix Error -21524: ISAM error: Cannot create a temporary operating system file to use in a sort.
Cause and resolution
ISAM error: Cannot create a temporary operating system file to use in a sort.
The database server could not create a temporary operating system file for this sort.
Consider setting the PSORT_DBTEMP environment variable to a secure directory with a minimum of 200 MB of free space.
-21524 Cannot create a temporary operating system file to use in a sort
A sort was being performed that did not use a dbspace partition to store overflow data. Overflow data is written to a temporary operating system file. However, the database server could not create a temporary operating system file for this sort. Consider setting the PSORT_DBTEMP environment variable to a secure directory with a minimum of 200 MB of free space. If PSORT_DBTEMP is not set then the database server stores overflow data in the /tmp or $INFORMIXDIR/tmp directory.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-21524 fires when the database server can't create a temporary operating-system file for a sort — per the official guidance.
- Insufficient space, or an unwritable directory, for the temporary sort file, per the official guidance's implication.
PSORT_DBTEMPnot set, per the official guidance — the server then falls back to/tmpor$INFORMIXDIR/tmpfor overflow data, which can itself lack space or permission.
Solutions / Resolution
- Set
PSORT_DBTEMPto a secure directory with at least 200 MB of free space, per the official guidance. - If
PSORT_DBTEMPis unset, check/tmp/$INFORMIXDIR/tmp(the fallback location) for free space and write permission, per the official guidance.
Examples
Setting PSORT_DBTEMP
$ export PSORT_DBTEMP=/informix/tmp
Diagnostic Checks
- Check
PSORT_DBTEMP's configured directory for free space and write permission, and correct it if it's missing, full, or unwritable. IfPSORT_DBTEMPis unset, check/tmp/$INFORMIXDIR/tmpinstead, since that's where the server falls back to.
Related Errors / Related Topics
- -21525 — "ISAM error: Cannot write to a temporary operating system file during a sort." A related sort-temp-file error, on writing to an already-created file rather than creating it.
The database server couldn't create a temporary sort file — set PSORT_DBTEMP to a
directory with enough free space.