If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Table lock on IDS

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-02-02, 10:23
mteruggi mteruggi is offline
Registered User
 
Join Date: Jul 2002
Location: Italy
Posts: 2
Table lock on IDS

I.
Is there someone who can tell me how I can remove table lock on IDS 7.31 without shutdown the instance?
Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 09-02-02, 20:12
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
The following is from Informix documentation regarding Unlock Table:

" You can only unlock a table that you locked. You cannot unlock a table that another process locked."
Reply With Quote
  #3 (permalink)  
Old 09-02-02, 20:20
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
Who has the lock on the table ? Why can't it be released ? If all else fails, try onmode -z sessionid - to kill the sessionid that has the lock on the table.
Reply With Quote
  #4 (permalink)  
Old 09-05-02, 02:55
eherber eherber is offline
Registered User
 
Join Date: Aug 2002
Location: Bonn/Germany
Posts: 152
Re: Table lock on IDS

Quote:
Originally posted by mteruggi
I.
Is there someone who can tell me how I can remove table lock on IDS 7.31 without shutdown the instance?
Thanks in advance

First you need to determine who is holding the lock on the
table. Perform the following steps:

1) get hexadecimal partitionnumber of this table
-> select tabname, hex(partnum) from systables
where tabname = "<yourtabname>"

2) Check if there are any locks placed on this table
-> onstat -k | grep -i <hex_partnum>

3) Get the 3rd column (owner) from the above grep-command
and use this in the following command
-> onstat -u | grep -i <owner_value>

Now you have the session-ID of the user holding the lock in
the 3rd column of the output from command 3).
You can use this session-ID to terminate the session using
"onmode -z <session_id>".

A few things to consider:

Only locks with type "HDR+X" or "HDR+S" and rowid "0"
from command 2) are real table locks.
It might also be that there are individual row or page locks on
the table or an open cursor which prevents you from locking
the table exclusively.
Command 2) should give you the details.

You might also consider using my lockwait-program, which might help you analyzing these lock situations. You can download it
from the following URL:

http://www.herber-consulting.de
-> RightSide (Informix Infos -> Utility-Download -> lockwt)

HTH.

Best regards

Eric
--
IT-Consulting Herber
www.herber-consulting.de
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On