Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2002
    Location
    Italy
    Posts
    2

    Unanswered: 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

  2. #2
    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."

  3. #3
    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.

  4. #4
    Join Date
    Aug 2002
    Location
    Bonn/Germany
    Posts
    152

    Re: Table lock on IDS

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •