Informix Error -318
-318 File with the same name as specified log file already exists.
The transaction log file you specify in the WITH LOG IN clause cannot already exist. The database server must start a new log file; it cannot append log data to an old log file. An existing log file contains recovery information that might be crucial, so it does not simply empty an existing file. To begin logging for a database that has not been logged before, lock the database, copy all of the database directory to a backup medium, and use the START DATABASE statement to name a new file. To make a partial archive subsequently, lock the database, copy the log file to a backup medium and store it with the full archive, erase or rename the log file, and use the START DATABASE statement.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-318 fires when the transaction log file named in a WITH LOG IN clause (used with START DATABASE to begin logging for a previously unlogged database) already exists on disk. The server
refuses to reuse or overwrite an existing log file, since existing log files hold recovery
information that must never be silently discarded.
- A prior logging setup attempt left a log file behind at the same path, and a repeat attempt reuses the same filename.
- Re-running a
START DATABASE ... WITH LOG INsetup script without cleaning up or renaming the log file from a previous run. - A partial-archive workflow reusing the same log filename instead of moving the prior log file to backup storage first, per the required procedure.
- A filename collision with an unrelated file that happens to share the path chosen for the new log file.
Solutions / Resolution
- Never reuse an existing log filename directly — per the official guidance, the server intentionally won't overwrite or append to one.
- To begin logging for an unlogged database: lock the database, back up the entire database
directory, then issue
START DATABASE ... WITH LOG IN '<new-log-file>'using a filename that doesn't already exist. - For subsequent partial archives: lock the database, copy the existing log file to backup
storage, remove or rename the original log file, then issue a new
START DATABASEstatement with a fresh filename (or the now-vacated one). - Check for and clean up leftover log files from a prior failed or aborted setup attempt before retrying with the same name.
Examples
Retrying with a fresh filename
START DATABASE sales WITH LOG IN '/informix/logs/sales.log';
-- -318: sales.log already exists from a previous attempt
Fix — back up/remove the old file first, or use a new name:
-- after backing up or removing /informix/logs/sales.log:
START DATABASE sales WITH LOG IN '/informix/logs/sales.log';
-- or, without removing the old one:
START DATABASE sales WITH LOG IN '/informix/logs/sales_2026.log';
The partial-archive procedure
1. LOCK the database.
2. Copy the current log file to backup storage.
3. Remove or rename the original log file.
4. Issue START DATABASE ... WITH LOG IN with the (now available) filename.
Diagnostic Checks
- Check whether the target log filename already exists on disk before issuing
START DATABASE ... WITH LOG IN. - Review whether this is a first-time logging setup or a partial-archive re-run — the correct procedure differs slightly between the two.
Related Errors / Related Topics
- -310 — "Table table-name already exists in database." A conceptually similar already-exists restriction, though at the object-naming level rather than the filesystem level.
The server will never overwrite an existing log file — back it up and remove/rename it first, or choose a genuinely new filename for the log.