unlocking locks
Posted in 2005
Topics: Versions, Editions & End-of-Life
Hi All, What is the easiest way to list down all the locks and kill them ( particular lock ) . I have some procedures which locks a tables. Sometimes these procedures break causing the tables to be locked. We are trying to find out which procedures are actually causing the problem. I use IDS 9.4UC4 on linux. Thanks in advance. -- Anil Menon x MIS Team. I'll try till I die or die trying.
Anil If you are talking about internal row/index/table locks, once the holding process has been removed/deleted then the lock will be released. If however you have 'soft' application locking then you will need to write some SQL to identify this within your application and then reset them. Keith -> -----Original Message----- -> From: Anil Menon [mailto:anil@rhythm.com] -> Sent: Wednesday, March 09, 2005 9:36 AM -> To: ids@iiug.org -> Subject: unlocking locks [4447] -> -> -> Hi All, -> What is the easiest way to list down all the locks and kill them ( -> particular lock ) . -> I have some procedures which locks a tables. Sometimes these -> procedures -> break causing the tables to be locked. We are trying to find -> out which -> procedures are actually causing the problem. -> -> I use IDS 9.4UC4 on linux. -> -> Thanks in advance. -> -> -- -> Anil Menon -> x MIS Team. -> -> I'll try till I die or die trying. -> -> ******************************************************************************** ** This message is sent in strict confidence for the addressee only. It may contain legally privileged information. The contents are not to be disclosed to anyone other than the addressee. Unauthorised recipients are requested to preserve this confidentiality and to advise the sender immediately of any error in transmission. This footnote also confirms that this email message has been swept for the presence of computer viruses, however we cannot guarantee that this message is free from such problems. ******************************************************************************** **
Hi, I execute in shell: dbaccess sysmaster locks.sql
where locks.sql is:
select * from syslocks where dbsname <> 'sysmaster'
Bye.
Hi,
"onstat -k" lists all the locks.
Check the manual "Admin's Reference Guide" for
more info. The tablespace number (tblsnum) is the
partnum of the table in the respective database.
So being connected to the respective database
you can do something like
SELECT * FROM systables WHERE partnum=<tblsnum from onstat -k>;
to find out, which table is affected by the lock.
Unfortunately there is no way to "kill" a lock.
Locks are held by sessions. Unless the session is
releasing the lock by itself it can't be "taken away" from
outside.
However, you can kill the session which then will release
the lock ...
You find the session number via the "owner" column in "onstat -k"
output. Look for this owner in output of "onstat -u" which will give you
the session id, which you can then use for "onstat -g ses <session id>"
or "onmode -z <session id>" (the latter kills the session).
Regards,
Martin
--
Martin Fuerderer
IBM Informix Development Munich, Germany
Information Management
forum.subscriber@iiug.org wrote on 09.03.2005 10:36:18:
> Hi All,
> What is the easiest way to list down all the locks and kill them (
> particular lock ) .
> I have some procedures which locks a tables. Sometimes these procedures
> break causing the tables to be locked. We are trying to find out which
> procedures are actually causing the problem.
>
> I use IDS 9.4UC4 on linux.
>
> Thanks in advance.
>
> --
> Anil Menon
> x MIS Team.
>
> I'll try till I die or die trying.
Related threads
- record locked
- who locks a record?
- Regarding Non-Default Page Sizes
- Don't Understand Table's Space Requirement