Informix Error -347
-347 Could not open table for exclusive access.
The database server cannot complete a LOCK TABLE statement or the implicit LOCK TABLE that must be performed as part of other statements that change the definition of a table (for example ALTER TABLE, RENAME, or CREATE INDEX). Check the accompanying ISAM error code for more detailed information on the cause. Possible causes include lock conflicts, a full lock table, or low-level problems with the host operating-system lock mechanism.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-347 fires when an explicit LOCK TABLE (or the implicit exclusive lock required by structural
statements like ALTER TABLE, RENAME, or CREATE INDEX) can't be obtained.
- Lock conflicts — another session already holds a lock on the table incompatible with exclusive access.
- The server's lock table is full — a system-wide configuration limit (
LOCKSin theonconfigfile) has been reached, and no new locks can be granted regardless of the specific table. - Low-level operating-system lock mechanism issues — a rarer, infrastructure-level failure below the database server itself.
Solutions / Resolution
- Check the accompanying ISAM error code first, per the official guidance, for the specific underlying reason.
- Check for other sessions holding locks on the table:
SELECT l.tabname, l.owner, s.username FROM sysmaster:syslocks l, sysmaster:syssessions s WHERE l.owner = s.sid AND l.tabname = 'orders'; - Check the server's current lock usage against its configured
LOCKSlimit:
(the basic status summary, which includes aonstat -Locksrow showing used vs. configured). If the lock table is full, either wait for other activity to release locks or consider increasing theLOCKSconfiguration parameter (a DBA/configuration change, not a query fix). - Schedule structural DDL during a lower-traffic window if lock contention is the recurring cause, since exclusive access competes directly with normal application activity.
Examples
Checking for lock contention before a DDL operation
SELECT l.tabname, l.owner, s.username FROM sysmaster:syslocks l, sysmaster:syssessions s
WHERE l.owner = s.sid AND l.tabname = 'orders';
-- if populated, wait for those sessions to complete or coordinate
-- with them before retrying the DDL
Checking overall lock table utilization
onstat -
-- look at the Locks row for used-vs.-configured numbers
Diagnostic Checks
- Read the accompanying ISAM error code for the specific underlying reason.
- Check
sysmaster:syslocksfor conflicting locks on the target table. - Check
onstat -for overall lock table utilization against the configuredLOCKSlimit.
Related Errors / Related Topics
- -314 — "Table table-name currently in use." A closely related concurrent-access failure — both concern obtaining exclusive-enough access to a table for a structural operation.
- -346 — "Could not update a row in the table." Another storage-engine-level failure that can share lock contention as a root cause.
Check both table-specific lock contention and overall lock-table capacity — a full lock table (a server-wide condition) can produce this same error even without any conflict on this specific table.