在 Linux 上的 IBM Informix 中出现错误 -25595(通常写作 25595 或 -25595)时,含义是:
-25595: Cannot create a temporary file.
也就是 Informix 无法创建临时文件。
Informix 默认会在 DBTEMP 或系统临时目录(如 /tmp)中创建临时文件。
检查:
df -h /tmp
解决:
/tmpDBTEMP 指向空间充足的目录:export DBTEMP=/informix/tmp
Informix 运行用户(通常是 informix)必须对临时目录有写权限。
检查:
ls -ld /tmp
id informix
解决:
chown informix:informix /informix/tmp
chmod 1777 /informix/tmp
如果 DBTEMP 指向了不存在或不可写的目录,会直接报 25595。
检查:
echo $DBTEMP
onconfig | grep DBTEMP
解决: 确保目录存在且可写。
即使磁盘有空间,用户可能被限制了磁盘配额。
检查:
quota -u informix
df -i /tmp
复杂 SQL(排序、GROUP BY、JOIN)会大量使用临时文件。
优化建议:
DS_TOTAL_MEMORY)df -h /tmpls -ld $DBTEMPid informixonconfig 中 DBTEMPonline.log 是否有更详细信息如果你愿意,可以贴出:
onconfig 中 DBTEMP 设置df -h 输出我可以帮你更精确定位。