如果遇到db2表空间被锁,重启数据库, 无效,怎么办呢?下文就为您介绍db2表空间被锁的解决方法,如果您遇到过db2表空间被锁的问题,不妨一看。
错误代码是
Table space access is not allowed. SQLSTATE=55039
force application all
db2stop
db2start
>;db2 "list tablespace containers for 2 show detail"|pg
Tablespace Containers for Tablespace 2
Container ID = 0
Name = /dev/rhisdb01
Type = Disk
Total pages = 5242880
Useable pages = 5242848
Accessible = Yes
容器是正常的阿
正常表空间状态是
State = 0x0000
Detailed explanation:
Normal
现在表空间状态是
Tablespace ID = 4
Name = ff
Type = Database managed space
Contents = Any data
State = 0x0004
Detailed explanation:
Quiesced: EXCLUSIVE
如何解除这种状态
Enter db2 "list tablespaces show detail".
Find the tablespace id and object id that have the tablespace in this state.
Look at the system catalog table syscat.tables to determine to which table the object id refers.
Reissue the load with the replace or restart option against this table.
编码时死锁是很常见的事情,没有理由去指责程序员的疏忽,死锁后及时的排除死锁才是最重要的。我的问题已经得到解决,方法是利用第三方工具对挂起的表空间中的所有表进行quiesce reset,另外谢谢anto的指点
,但不知"Find the tablespace id and object id that have the tablespace in this state"中object id 是指什么?怎么查找?
object id just like this
'表空间标识 = 0'
应该是吧![/quote]
tablespace id 应该是表空间标识的id,而object id应该是造成死锁表的id,然后可以通过 select tabname from syscat.tables where tableid=object id,来得到表的名称,最后用quiesce tablespaces for table tablename reset语句来清除这样状态。
经过验证已找到答案如下
Number of quiescers = 1
Quiescer 1:
Tablespace ID = 2
Object ID = 3338
朋友们,为了不要deallock,请千万不要在 Commit & Rollback 前放 MessageBox
【编辑推荐】