Re: Help on locking - while flying blind
Posted in 1997
On Mon, 29 Sep 1997 10:04:27 -0400, "Art S. Kagel"
<kagel@bloomberg.com> wrote:
>>
>> Any help on how to view current locks in Informix will be much
>> appreciated.
>
>You can look at locks using the onstat (tbstat for 5.0x) utility.
>Onstat -k reports locks, the owner column is then looked up in the
>onstat -u report under the the address column from this report. Get the>sessid corresponding to the owner address and run onstat -g ses <sessid>
>(for 5.0x the tbstat -u reports pid rather than sessid and a
>ps -fp <pid> will show both the sqlturbo process its parent is your
>application which owns the lock). The onstat -g ses report shows the
>current and last SQL, the userid, pid, and much other info. You can
>then
>use ps -fp <pid> to find the application (7.xx has no sqlturbo process
>so
>the pid here is your app).
>
>I suspect that your tables were created with the default locking level,
>page level locking. Try "alter table <mytable> lock mode (row);" on
>any table which may experience contention problems. This will reduce
>lock contention. Another feature to try is to "set lock mode to wait
><nseconds>;" in your applications so that instantaneous locks do not
>block you users.
>
>Art S. Kagel
Art,
You're a life-saver! This is great stuff.
Thanks
Fuzzy
:-)