在删除某表的时候报错SQL0911N:
[code]db2 => drop table vgopapp.dw_product_ms_201404;
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0911N The current transaction has been rolled back because of a deadlock
or timeout. Reason code "68". SQLSTATE=40001[/code]
查看数据库中的锁:
[code]$ db2 "select agent_id, tabname from sysibmadm.snaplock"
AGENT_ID TABNAME
-------------------- --------------------------------------------------------------------------------------------------------------------------------
56666 -
56666 -
56666 -
56666 -
57843 -
57843 SYSTABLES
57843 DW_PRODUCT_MS_201404
45 record(s) selected.[/code]
发现该表被57843会话锁定,db2top 查看会话57843的详细情况,确认后断开会话
[code]$ db2 "force application (57843)"
DB20000I The FORCE APPLICATION command completed successfully.
DB21024I This command is asynchronous and may not be effective immediately.[/code]
重新执行drop操作,正常:
[code]db2 => drop table vgopapp.dw_product_ms_201404;
DB20000I The SQL command completed successfully.
db2 =>[/code]
[code]db2 => drop table vgopapp.dw_product_ms_201404;
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0911N The current transaction has been rolled back because of a deadlock
or timeout. Reason code "68". SQLSTATE=40001[/code]
查看数据库中的锁:
[code]$ db2 "select agent_id, tabname from sysibmadm.snaplock"
AGENT_ID TABNAME
-------------------- --------------------------------------------------------------------------------------------------------------------------------
56666 -
56666 -
56666 -
56666 -
57843 -
57843 SYSTABLES
57843 DW_PRODUCT_MS_201404
45 record(s) selected.[/code]
发现该表被57843会话锁定,db2top 查看会话57843的详细情况,确认后断开会话
[code]$ db2 "force application (57843)"
DB20000I The FORCE APPLICATION command completed successfully.
DB21024I This command is asynchronous and may not be effective immediately.[/code]
重新执行drop操作,正常:
[code]db2 => drop table vgopapp.dw_product_ms_201404;
DB20000I The SQL command completed successfully.
db2 =>[/code]
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




