Informix Error -21525: ISAM error: Cannot write to a temporary operating system file during a sort.
Cause and resolution
ISAM error: Cannot write to a temporary operating system file during a sort.
The database server could not write to the temporary operating system file, most likely because the file directory is out of space.
-21525 Cannot write to a temporary operating system file during 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 write to this temporary operating system file, most likely because the file directory is out of space. The location of this file is in the path specified by the PSORT_DBTEMP environment variable. If PSORT_DBTEMP is not set then the database server puts these temporary files in the /tmp or $INFORMIXDIR/tmp directory.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-21525 fires when the database server can't write to a temporary operating-system file during a sort — per the official guidance, a sort not using a dbspace partition for overflow writes its overflow data to a temporary OS file, and that write failed, most likely because the file's directory ran out of space.
- The temporary sort file's directory running out of space, per the official guidance — the direct, most likely cause.
PSORT_DBTEMPnot set, per the official guidance — the server then writes overflow data to/tmpor$INFORMIXDIR/tmpinstead, which can itself run out of space.
Solutions / Resolution
- Free space in, or repoint
PSORT_DBTEMPto, a directory with enough free space, per the official guidance's implication. - If
PSORT_DBTEMPis unset, check/tmp/$INFORMIXDIR/tmp(the fallback location) for free space instead, 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 free space or repoint it if full. IfPSORT_DBTEMPis unset, check/tmp/$INFORMIXDIR/tmpinstead, since that's where the server falls back to.
Related Errors / Related Topics
- -21524 — "ISAM error: Cannot create a temporary operating system file to use in a sort." A related sort-temp-file error, on creating the file rather than writing to an already-created one.
A sort's temporary overflow file couldn't be written to, most likely because its directory
ran out of space — free space or repoint PSORT_DBTEMP.