ISAM error: the file is locked.
Posted in 2004
Topics: Error Codes & Troubleshooting
I don't have much
experience in Informix with using locks/interpreting
error messages involving locks. There is generally nothing running
against the database except a C/Fortran data ingest program. I'm
getting the message below when I try to execute a simple script
containing select counts for the half dozen tables being fed by the
ingest. The first select executes but then this message shows up.
Occasionally the script runs in its entirety but generally I'm getting
this error message.
I've run onstat -u and -k and am not certain what I'm looking at or
for. I believe the Informix version is 9.3 and the operating system is
Redhat 7.2.
Any suggestions are appreciated.
Thanks,
Monica
252: Cannot get system information for table.
113: ISAM error: the file is locked.
That is
because if a table has been locked due to and update process or whatever then
your script cannot access that table.
So there are 2 solutions :
1. Use "set isolation to dirty read; " phrase before each "select count(*)
from <tablename>.
Or
2. When u get the error, investigate which table is locked and run ur count on
that table when its not locked.
(Read about locking in Informix before u do anything not to harm your
production environment !)
Hope this helps.
monica toth <monica.toth@noaa.gov> wrote:
I don't have much experience in Informix with using locks/interpreting
error messages involving locks. There is generally nothing running
against the database except a C/Fortran data ingest program. I'm
getting the message below when I try to execute a simple script
containing select counts for the half dozen tables being fed by the
ingest. The first select executes but then this message shows up.
Occasionally the script runs in its entirety but generally I'm getting
this error message.
I've run onstat -u and -k and am not certain what I'm looking at or
for. I believe the Informix version is 9.3 and the operating system is
Redhat 7.2.
Any suggestions are appreciated.
Thanks,
Monica
252: Cannot get system information for table.
113: ISAM error: the file is locked.
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
The
easy answer is to add the following line at the top of the SQL
statements in your script:
SET ISOLATION TO DIRTY READ;
That will let it ignore locks, but it could make your count snapshot a
little blurry.
Since you're getting locks so frequently, there is something wrong - it
could be the tables have grown over too many extents, you need to update
statistics, design better indexes or review the program running against it.
-----Original Message-----
From: forum.subscriber@iiug.org [mailto:forum.subscriber@iiug.org] On Behalf
Of monica toth
Sent: Wednesday, March 17, 2004 2:37 PM
To: ids@iiug.org
Subject: ISAM error: the file is locked. [2685]
I don't have much experience in Informix with using locks/interpreting
error messages involving locks. There is generally nothing running
against the database except a C/Fortran data ingest program. I'm
getting the message below when I try to execute a simple script
containing select counts for the half dozen tables being fed by the
ingest. The first select executes but then this message shows up.
Occasionally the script runs in its entirety but generally I'm getting
this error message.
I've run onstat -u and -k and am not certain what I'm looking at or
for. I believe the Informix version is 9.3 and the operating system is
Redhat 7.2.
Any suggestions are appreciated.
Thanks,
Monica
252: Cannot get system information for table.
113: ISAM error: the file is locked.
If you
haven't already done this, you might also try changing the lock
mode on the table to row locking instead of page locking, as follows:
alter table table_name lock mode (row);
Joe V.
-----Original Message-----
From: Danny Wright [mailto:dwright@sherwoodfoods.com]
Sent: Wednesday, March 17, 2004 6:04 PM
To: ids@iiug.org
Subject: RE: ISAM error: the file is locked. [2687]
The easy answer is to add the following line at the top of the SQL
statements in your script:
SET ISOLATION TO DIRTY READ;
That will let it ignore locks, but it could make your count snapshot a
little blurry.
Since you're getting locks so frequently, there is something wrong - it
could be the tables have grown over too many extents, you need to update
statistics, design better indexes or review the program running against
it.
-----Original Message-----
From: forum.subscriber@iiug.org [mailto:forum.subscriber@iiug.org] On
Behalf
Of monica toth
Sent: Wednesday, March 17, 2004 2:37 PM
To: ids@iiug.org
Subject: ISAM error: the file is locked. [2685]
I don't have much experience in Informix with using locks/interpreting
error messages involving locks. There is generally nothing running
against the database except a C/Fortran data ingest program. I'm
getting the message below when I try to execute a simple script
containing select counts for the half dozen tables being fed by the
ingest. The first select executes but then this message shows up.
Occasionally the script runs in its entirety but generally I'm getting
this error message.
I've run onstat -u and -k and am not certain what I'm looking at or
for. I believe the Informix version is 9.3 and the operating system is
Redhat 7.2.
Any suggestions are appreciated.
Thanks,
Monica
252: Cannot get system information for table.
113: ISAM error: the file is locked.