How to remove locks
Posted in 2007
A user on IDS 9.40 (Solaris) had row locks stuck on a table after a Windows client process was killed; onstat -k still showed three locks, queries returned "ISAM error: record locked", and even UNLOCK TABLE and restarting the server didn't clear them. Suggestions included querying sysmaster/syslocks (joined with syssessions) to identify the lock owner and killing it with onmode -z, noting Windows clients often leave sessions hanging, plus advice to contact tech support before bouncing the engine. The poster zapped one session but orphan locks remained; IBM tech support ultimately fixed it and identified it as a bug.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Transactions, Locking & Isolation, Platform-Specific Issues, Versions, Editions & End-of-Life
Hi everybody Im urged to know how to remove locks from some rows in a table. A process on a windows server was working on a table in a IDS 9.40 Solari= s informix server. For some reason, users on that server kill the process= and disconnect. In my server, the table remains marked with locks on rows, but there are = any query or session from that process. Even the IDS was restarted and t= ried to UNLOCK TABLE but I still see three locks on the table after the o= nstat -k command. When i do query for certain rows ids answers "... ISAM ... record locked= ..." or someting like that. It cant be onchecked on deleted. Thanks in advance for your comments. Greetings. --Nestor
Hi,
Did you have a crash of the database ?
I once encountered a session which was remaining after a restart.
I could not get rid of it, until the database crashed again. Then it was
gone.
I was about to restore from tape, but then the crash reoccured and the
session was gone.
For "normal" locks:
Try to execute the following script to find out which session is the
lock owner:
(search the session with onstat -u and try to kill it with onmode -z)
database sysmaster;
set isolation to dirty read;
set isolation to dirty read;
select
--dbsname
tabname
,rowidlk
--,keynum
,type
--,owner
,waiter sid_waiter
,b.username lock_waiter
,a.sid sid_owner
,a.username lock_owner
--,uid
--,pid
--,hostname
--,tty
--,connected
--,feprogram
--,pooladdr
--,is_wlatch
--,is_wlock
--,is_wbuff
--,is_wckpt
--,is_wlogbuf
--,is_wtrans
--,is_monitor
--,is_incrit
--,state
from syslocks, syssessions a, syssessions b
where owner = a.sid
and waiter = b.sid;
If this session is no longer existing, the transaction might be existing
(XA-Transaction ?).
Marcus
-----Original Message-----
From: NESTOR GOMEZ MUNOZ [mailto:nestorgm@prodigy.net.mx]
Sent: Thursday, March 22, 2007 5:34 PM
To: ids@iiug.org
Subject: How to remove locks [8705]
Hi everybody
Im urged to know how to remove locks from some rows in a table.
A process on a windows server was working on a table in a IDS 9.40
Solari= s informix server. For some reason, users on that server kill
the process= and disconnect.
In my server, the table remains marked with locks on rows, but there are
= any query or session from that process. Even the IDS was restarted and
t= ried to UNLOCK TABLE but I still see three locks on the table after
the o= nstat -k command.
When i do query for certain rows ids answers "... ISAM ... record
locked= ...." or someting like that. It cant be onchecked on deleted.
Thanks in advance for your comments. Greetings.
--Nestor
************************************************************************
*******
Forum Note: Use "Reply" to post a response in the discussion forum.
So you still have the lock on the table even though the session which had locked the table is not connected....is it correct? Locks are kept in memory so if you bounce the db you should not see the lock. However, I would talk to tech support first, they could have a look at the shared memory structures before you bounce the server. hth esteban.- ----- Mensaje original ---- De: NESTOR GOMEZ MUNOZ <nestorgm@prodigy.net.mx> Para: ids@iiug.org Enviado: jueves 22 de marzo de 2007, 16:33:37 Asunto: How to remove locks [8705] Hi everybody Im urged to know how to remove locks from some rows in a table. A process on a windows server was working on a table in a IDS 9.40 Solari= s informix server. For some reason, users on that server kill the process= and disconnect. In my server, the table remains marked with locks on rows, but there are = any query or session from that process. Even the IDS was restarted and t= ried to UNLOCK TABLE but I still see three locks on the table after the o= nstat -k command. When i do query for certain rows ids answers "... ISAM ... record locked= ...." or someting like that. It cant be onchecked on deleted. Thanks in advance for your comments. Greetings. --Nestor ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum. __________________________________________________ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Probalo ya! http://www.yahoo.com.ar/respuestas
On Mar 22, 2007, at 1:31 PM, Esteban Casuscelli wrote: > So you still have the lock on the table even though the session > which had > locked the table is not connected....is it correct? > > Locks are kept in memory so if you bounce the db you should not see > the lock. > However, I would talk to tech support first, they could have a look > at the > shared memory structures before you bounce the server. > > hth > esteban.- > > ----- Mensaje original ---- > De: NESTOR GOMEZ MUNOZ <nestorgm@prodigy.net.mx> > Para: ids@iiug.org > Enviado: jueves 22 de marzo de 2007, 16:33:37 > Asunto: How to remove locks [8705] > > Hi everybody > > Im urged to know how to remove locks from some rows in a table. > A process on a windows server was working on a table in a IDS 9.40 > Solari= > s informix server. For some reason, users on that server kill the > process= > and disconnect. > In my server, the table remains marked with locks on rows, but > there are = > any query or session from that process. Even the IDS was restarted > and t= > ried to UNLOCK TABLE but I still see three locks on the table after > the o= > nstat -k command. > > When i do query for certain rows ids answers "... ISAM ... record > locked= > ....." or someting like that. It cant be onchecked on deleted. > > Thanks in advance for your comments. Greetings. > > --Nestor > > > ********************************************************************** > ********* > Forum Note: Use "Reply" to post a response in the discussion forum. > > __________________________________________________ > Preguntá. Respondé. Descubrí. > Todo lo que querías saber, y lo que ni imaginabas, > está en Yahoo! Respuestas (Beta). > ¡Probalo ya! > http://www.yahoo.com.ar/respuestas > > > ********************************************************************** > ********* > Forum Note: Use "Reply" to post a response in the discussion forum. >
Windows client right? Windows is REALLY bad about cleaning up TCP sockets when
an app exits abnormally which leaves the IDS session hanging waiting for a
response from the defunct client app. You should be able to kill the session.
On a UNIX IDS server you'd use onmode -z to kill the session in the server
which
would free the resources the session is holding. Don't know the Windows
equivalent if it's not onmode. Christine's suggestion to bounce the server will
also work, though it's drastic.
Art S. Kagel
----- Original Message -----
From: Nestor Gomez Munoz <ids@iiug.org>
At: 3/22 12:34:14
Hi everybody
Im urged to know how to remove locks from some rows in a table.
A process on a windows server was working on a table in a IDS 9.40 Solari=
s informix server. For some reason, users on that server kill the process=
and disconnect.
In my server, the table remains marked with locks on rows, but there are =
any query or session from that process. Even the IDS was restarted and t=
ried to UNLOCK TABLE but I still see three locks on the table after the o=
nstat -k command.
When i do query for certain rows ids answers "... ISAM ... record locked=
...." or someting like that. It cant be onchecked on deleted.
Thanks in advance for your comments. Greetings.
--Nestor
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
Ok. Thanks to all of you for your comments.
The issue was resolved for technical support. I was able to zap one
session but there were other locks with no owner. I even did a bounce=
to
informix too. After all, tech support fix it and told it was a bug.
Best regards.
El vie, 23-03-2007 a las 07:08 -0500, ART KAGEL, BLOOMBERG/ 731 LEXIN
escribi=C3=B3:
> Windows client right? Windows is REALLY bad about cleaning up TCP s=
ockets when=20
> an app exits abnormally which leaves the IDS session hanging waitin=
g for a=20
> response from the defunct client app. You should be able to kill th=
e session.=20
> On a UNIX IDS server you'd use onmode -z to kill the session in the=
server=20
> which=20
> would free the resources the session is holding. Don't know the Win=
dows=20
> equivalent if it's not onmode. Christine's suggestion to bounce the=
server=20
> will=20
> also work, though it's drastic.=20
>=20
> Art S. Kagel=20
>=20
> ----- Original Message -----=20
> From: Nestor Gomez Munoz <ids@iiug.org>=20
> At: 3/22 12:34:14=20
>=20
> Hi everybody=20
>=20
> Im urged to know how to remove locks from some rows in a table.=
=20
> A process on a windows server was working on a table in a IDS 9.40 =
Solari=3D=20
> s informix server. For some reason, users on that server kill the p=
rocess=3D=20
> and disconnect.=20
> In my server, the table remains marked with locks on rows, but ther=
e are =3D=20
> any query or session from that process. Even the IDS was restarted =
and t=3D=20
> ried to UNLOCK TABLE but I still see three locks on the table after=
the o=3D=20
> nstat -k command.=20
>=20
> When i do query for certain rows ids answers "... ISAM ... record l=
ocked=3D=20
> ....." or someting like that. It cant be onchecked on deleted.=20
>=20
> Thanks in advance for your comments. Greetings.=20
>=20
> --Nestor=20
>=20
>=20
> *******************************************************************=
************=20
> Forum Note: Use "Reply" to post a response in the discussion forum.=
=20
>=20
>=20
> *******************************************************************=
************=20
> Forum Note: Use "Reply" to post a response in the discussion foru=
m.=20
>=20