Informix Error -340
-340 Cannot open audit trail file.
The database server needs to use the audit-trail file for this table, but some unexpected problem prevents it. Likely causes include hardware errors, file-permission problems, or the accidental erasure of the file. Look for operating-system error messages that might give more information.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-340 fires when the server needs to open an existing audit-trail file for a table and can't —
distinct from -334 (creating a new one) in that this is about reopening one the server already
expects to be there.
- The audit-trail file was accidentally deleted outside of Informix's own audit-management tooling.
- File permission issues preventing the server process from opening the file.
- Hardware failures affecting the disk or filesystem where the audit-trail file resides.
- The file was moved or renamed externally, breaking the server's recorded path to it.
Solutions / Resolution
- Check operating-system error messages around the same time, per the official guidance, for the specific underlying reason.
- Confirm the audit-trail file still exists at its expected path and hasn't been accidentally deleted or moved.
- Check filesystem-level permissions for the Informix server process on the file.
- Check for underlying hardware/disk problems if permissions and presence both check out.
- If the file is genuinely gone, drop and recreate the audit trail (
DROP AUDITthen a freshCREATE AUDIT/START AUDIT) rather than trying to recover the original file.
Examples
Confirming the file's presence and permissions
ls -la /informix/audit/audit_trail_1
-- confirm it exists, and that the Informix server process has
-- read/write access to it
Recreating a genuinely lost audit trail
DROP AUDIT;
CREATE AUDIT USING '/informix/audit/audit_trail_new';
Diagnostic Checks
- Check operating-system error messages logged around the same timestamp.
- Confirm the audit-trail file's presence, path, and permissions.
- Check for disk/hardware-level problems on the filesystem hosting it.
Related Errors / Related Topics
- -334 — "Cannot create audit trail." The creation-time counterpart of this open failure.
- -338 — "Cannot drop audit trail." Another audit-trail-lifecycle infrastructure failure.
Check the file's actual presence and permissions on disk before assuming a deeper hardware problem — accidental deletion or a permissions change outside Informix's own tooling is the more common cause.