加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

informix 锁表处理

(2007-07-13 18:53:18)
标签:

informix

锁表

sql

分类: 数据库
 

informix 锁表相关错误代码如下:

?/P>

 What error messages are caused by locking problems?

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>

具体处理步骤如下:

suinformix用户里(su - informix

1、找出锁表的用户

onstat -ks|grep HDR+X

?/P>

c 0000000006f4c48 0   c0000000076aad30 c000000000788738 HDR+X    2000c3   694300    0

c00000000074b648 0   c0000000076aad30 c000000000779938 HDR+X    200448   b7800     1

c000000000779938 0   c0000000076aad30 c0000000006de4a8 HDR+X    200448   61400     1

c000000000788738 0   c0000000076aad30 c00000000074b648 HDR+X    200448   2e900     1

?/P>

信息对应标题如下(因使用了grep,所以是没有标题的):

?/P>

IBM Informix Dynamic Server Version 9.40.FC4     -- On-Line -- Up 77 days 20:05:07 -- 277012 Kbytes

?/P>

Latches with lock or userthread set

name     address           lock wait userthread       

?/P>

Locks address      wtlist  owner          lklist             type          tblsnum  rowid  key#/bsiz

锁地址    等待线程列表  用户           列表     锁类型                 id   

?/P>

2、根据用户编号(owner)找到对应的会话id

onstat -u | grep c0000000076aad30

?/P>

c0000000076aad30 Y--P--- 99641    informix -        c0000000102c5430 0    1     21633    252

?/P>

信息对应标题如下(因使用了grep,所以是没有标题的):

?/P>

IBM Informix Dynamic Server Version 9.40.FC4     -- On-Line -- Up 77 days 20:41:08 -- 277012 Kbytes

?/P>

Userthreads

address          flags   sessid   user     tty      wait             tout locks nreads   nwrites

地址(即owner 标志  会话id

?/P>

3、杀掉会话

onmode -z 99641

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有