IDS 7.x or 9.x
How can I determine the user / session who locks a specific DB table?
(I try to alter a table from within dbaccess and got the message "non
exclusive access")
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.495 / Virus Database: 294 - Release Date: 30/6/2003
↪ replying to Pantelis Magos
The
sixth column of onstat -k is the table partnum in hex without the
leading 0x and zeros, and with characters in lower case.
The third column of onstat -k is the Userthread's address
So...
1. select hex(partnum) for your table from systables
2. Format to onstat -k specs as above.
3. Grep result to onstat -k
4. grep third column output to onstat -u
This works where a lock is preventing you from getting an exclusive
lock.
This is from my notes.
# Author: Jacob Salomon
# Date: 07/15/1999
# Credits: Original idea from a script by:
# Rick Bernstein, <rbernste@alarismed.com>
#
# This script fills in an inadequecy in who-lock.sh: who-lock.sh can
# only detect a user's presence on a table by detecting a lock. A user
# operating in dirty read does not always leave locks; yet there is
# enough access to prevent operations like "alter table" that require
# exclusiove access. This script corrects the oversight by using the
# output of onstat -g opn to search for threads that have the table
# open.
This script who-access.sh, I think, might be available from the
iiug.org
HTH,
Zev Berezin
IBM Informix DBA
On 8 Aug 2003, at 8:00, Pantelis Magos wrote:
> IDS 7.x or 9.x
>
> How can I determine the user / session who locks a specific DB table?
> (I try to alter a table from within dbaccess and got the message "non
> exclusive access")
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.495 / Virus Database: 294 - Release Date: 30/6/2003
>
>
>
>