标签:
informix锁表sql |
分类: 数据库 |
informix 锁表相关错误代码如下:
?/P>
The following SQL error codes can occur because of locking problems:
-233: Cannot read record that is locked by another user.
-240: Could not delete a row.
-244: Could not do a physical-order read to fetch next row.
-245: Could not position within a file via an index.
-246: Could not do an indexed read to get the next row.
-250: Cannot read record from file for update.
-263: Could not lock row for update.
-271: Could not insert new row into the table.
-346: Could not update a row in the table.
-348: Could not read a row from the table.
-378: Record currently locked by another user.
?/P>
?/P>
346 Could not update a row in the table.
While the database server was processing an UPDATE, it received an unexpected error. Check the accompanying ISAM error code for more detailed information on the cause. Possible causes include hardware errors and locking conflicts.
?/P>
?/P>
?/P>
判定问题为锁表造成的。
?/P>
具体处理步骤如下:
先su到informix用户里(su - informix)
1、找出锁表的用户
onstat -ks|grep HDR+X
?/P>
c
0000000006f4c48
0
c00000000074b648
0
c000000000779938 0
c000000000788738 0
?/P>
信息对应标题如下(因使用了grep,所以是没有标题的):
?/P>
IBM Informix Dynamic Server Version
9.40.FC4
?/P>
Latches with lock or userthread set
name
?/P>
Locks
address
锁地址
?/P>
2、根据用户编号(owner)找到对应的会话id
onstat -u | grep c0000000076aad30
?/P>
c0000000076aad30 Y--P---
99641
?/P>
信息对应标题如下(因使用了grep,所以是没有标题的):
?/P>
IBM Informix Dynamic Server Version
9.40.FC4
?/P>
Userthreads
address
地址(即owner)
标志
?/P>
3、杀掉会话
onmode -z 99641