Quote:
>Hello out there in net-land...
>I have a question/problem regarding table locks. I am trying to drop an
>audit on a table and get a message indicating the table is locked...
>[...]
>If I try to issue an UNLOCK via SQL, I get a message that I'm not the user
>who locked the table in the 1st place.
I've seen this same situation from time to time. At least I used to when
Informix was using file-based (*.lok) locking under SunOS. We're up on a
version that uses kernel-based locking now, and I don't recall seeing it
recently.
Quote:
> 1) Where does Informix keep track of whether a table is locked and
> who has locked it?
For the Standard Engine, it may be either file- or kernel-based locking,
depending the OS.
Quote:
> 2) If there were any .lok files - where would they be? (I did a find
> from / and didn't get any results).
They would be in the *.dbs directory that holds the database. If you
weren't the owner of the database or root when you did the find, you wouldn't
have been able to descend into the directory. If you don't see any *.lok
files in the database directory, then your version is using kernel locking.
Quote:
> 3) If I unlock the table as dbadmin (assuming I can do this), what
> possible problems could this cause??
None, if you're 100,000% sure that there is no database activity when you
do it. With file-based locking, simply copy /dev/null on top of each
offending *.lok file. Make sure the permissions & ownerships stay in tact.
I'm not familiar with the internals of kernel-based locking. You may have
to go so far as to reboot the OS.
Quote:
> 4) What situations might cause the DB to believe that there is a lock
> on a table and can they be prevented?
Could be problems in the OS locking, Informix, etc. I have never been able
to figure out exactly.
One thing we saw here occurred when Informix changed from file to kernel
locking under SunOS. To be clean with the Informix upgrade, we unloaded
all data from the old database, the created a new copy under the new
Informix version and loaded the data. Thus, the new *.dbs directory had
no *.lok files.
Somehow, the new database got "touched" by the old Informix that used the
file locking. This was while we were playing with a test database, so
we weren't too upset. It was somewhat sobering, though, and reminded us
to keep very tight controls when we went into production with the new
verion.
Anyway, having spurious *.lok files in the database directory sometime
caused problems, even when the Informix version that used kernel locking
was running. If you're in that situation, you might check that.
Good luck,
Walt.
--
Emory University UUCP: {...,gatech,rutgers,uunet}!emory!rmy!walt
Atlanta, GA 30329 USA Voice: +1 404 727 0648