how to identify a locked processid
Posted in 2010
Topics: General Discussion
Hi All,
I want to know how to identify which process to be killed....I did "onstat
-u", and it shows the status "L---PR--". As i know, "L" stands for "Lock". I
also did "onstat -k" to show all the locks.
Questions:
1. Is the process with "L---PR--" status causing the problem?
2. What table is locked?
Hi,
you can do a query against sysmaster like the following:
select
sid,username,pid,tabname,type,owner,waiter
from
syssessions,syslocks
where
sid = owner
and
waiter IS NOT NULL
You get the session IDs of the session which holds a table lock (sid + pid =
process id) , the table name , and the session id of the session waiting for
that lock (waiter) .
If you want the process id of the locked session/process, you must translate
the waiter sessionid into a process id (from table syssessions or with onstat
-g ses |grep <waiter> ).
Regards,
Andreas
>
-------------------------------------------
SPAR Österreichische Warenhandels-AG
Hauptzentrale
A - 5015 Salzburg, Europastrasse 3
FN 34170 a
Tel: +43 662 4470 84923
Mobile: +43 664 6259575
E-Mail: Andreas.KUTSCHE@spar.at
Internet: http://www.spar.at
Wichtiger Hinweis: Der Inhalt dieser E-Mail kann vertrauliche und rechtlich
geschützte Informationen, insbesondere Betriebs- oder Geschäftsgeheimnisse,
enthalten, zu deren Geheimhaltung der Empfänger verpflichtet ist. Die
Informationen in dieser E-Mail sind ausschließlich für den Adressaten
bestimmt. Sollten Sie die E-Mail irrtümlich erhalten haben so ersuchen wir
Sie, die Nachricht von Ihrem System zu löschen und sich mit uns in Verbindung
zu setzen.
Über das Internet versandte E-Mails können leicht manipuliert oder unter
fremdem Namen erstellt werden. Daher schließen wir die rechtliche
Verbindlichkeit der in dieser Nachricht enthaltenen Informationen aus. Der
Inhalt der E-Mail ist nur rechtsverbindlich, wenn er von uns schriftlich
bestätigt und gezeichnet wird.
Sollte trotz der von uns verwendeten Virus-Schutzprogramme durch die Zusendung
von E-Mails ein Virus in Ihre Systeme gelangen, haften wir nicht für evtl.
hieraus entstehende Schäden.
Wir danken für Ihr Verständnis.
Important notice: The contents of this e-mail may contain confidential and
legally protected information that is in particular related to operational and
trade secrets, which the recipient is obliged to treat as confidential. The
information in this e-mail is made available exclusively for use by the
addressee. In the event that the e-mail may have been sent to you in error, we
would ask you to kindly delete this communication from your system and to
contact us.
E-mails sent via the Internet can be easily manipulated or sent out under
someone else's name. We therefore do not accept legal liability for the
information contained in this communication. The contents of the e-mail are
only legally binding if they have been confirmed and signed by us in writing.
If, in spite of our using Antivirus protection software, a virus may have
penetrated your system through the sending of this e-mail, we do not accept
liability for any damage that may possibly arise as a result of this.
We trust that you appreciate our position.
-------------------------------------------
-----Ursprüngliche Nachricht-----
> Von: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] Im Auftrag von
> JACK PAPA
> Gesendet: Mittwoch, 20. Januar 2010 07:18
> An: ids@iiug.org
> Betreff: how to identify a locked processid [18721]
>
> Hi All,
>
> I want to know how to identify which process to be killed....I did "onstat
> -u", and it shows the status "L---PR--". As i know, "L" stands for "Lock".
> I
> also did "onstat -k" to show all the locks.
>
> Questions:
>
> 1. Is the process with "L---PR--" status causing the problem?
> 2. What table is locked?
>
>
> **************************************************************************
> *****
> Forum Note: Use "Reply" to post a response in the discussion forum.
Search the onstat -k for lines showing exclusive locks (X) and take the
address from there and match it to the address in the onstat -u to find the
session holding the lock.
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
IIUG Board of Directors (art@iiug.org)
See you at the 2010 IIUG Informix Conference
April 25-28, 2010
Overland Park (Kansas City), KS
www.iiug.org/conf
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.
On Wed, Jan 20, 2010 at 1:17 AM, JACK PAPA <informix2009@gmail.com> wrote:
> Hi All,
>
> I want to know how to identify which process to be killed....I did "onstat
> -u", and it shows the status "L---PR--". As i know, "L" stands for "Lock".
> I
> also did "onstat -k" to show all the locks.
>
> Questions:
>
> 1. Is the process with "L---PR--" status causing the problem?
> 2. What table is locked?
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--0015174befc4722a04047d964747
Thank you Andreas/Art.
I did "onstat -k", and get the owner of the process. then, compared the owner
to the userid. I did onmode -z pid to kill that pid, and it looks fine... the
"L--PR---" status was not there anymore.