当前位置: 首页 > 图文教程 > 数据库 > MSSQL > SQL0290N表空间状态问题:停顿的独占处理

MSSQL
SQL Server 2005查看文件及文件组的语句
用最简单的步骤备份SQL数据库的文件到本地
在SQL Server数据库中拆分字符串函数
SQL Server数据库维度表和事实表概述
Microsoft SQL Server数据库日志截断
SQL Server 2000 SP4与数据链接池问题
SQL Server游标使用实例
SQL Server 2008:传递表值参数
微软SQL Server 2008令商业智能平民化
将SQL2000数据库升级到SQL2005
在SQL Server2005中进行错误捕捉
动态SQL语句的编程
SQL Server 2008升级报表服务器数据库
在SAN上创建SQL Server群集
SQL查询中的转义序列不对的解决办法
SQL2005一个不起眼但很实用的函数
管理SQL Server数据库和应用元数据
选择SQL Server恢复模型确保正确备份
查看SQL执行计划常用方法
SQL2008增强的集成开发环境

MSSQL 中的 SQL0290N表空间状态问题:停顿的独占处理


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-17   浏览: 81 ::
收藏到网摘: n/a

今天一个同事报告一个问题,表都不能使用了,检查了一下,发现

问题 db2 => select * from test

ACTNO ACTKWD ACTDESC

------ ------ --------------------

SQL0290N Table space access is not allowed. SQLSTATE=55039

其他表也不能使用

在db2cc里查看表空间状态为: 停顿的独占

解决方法:

到命令行状态,首先connect 到需要处理的数据库

◆1、db2 => list tablespaces show detail 显示表空间状态

Tablespaces for Current Database

Tablespace ID = 0

Name = SYSCATSPACE

Type = System managed space

Contents = Any data

State = 0x0000

Detailed explanation:

Normal

Total pages = 2519

Useable pages = 2519

Used pages = 2519

Free pages = Not applicable

High water mark (pages) = Not applicable

Page size (bytes) = 4096

Extent size (pages) = 32

Prefetch size (pages) = 32

Number of containers = 1

Tablespace ID = 1

Name = TEMPSPACE1

Type = System managed space

Contents = System Temporary data

State = 0x0000

Detailed explanation:

Normal

Total pages = 1

Useable pages = 1

Used pages = 1

Free pages = Not applicable

High water mark (pages) = Not applicable

Page size (bytes) = 4096

Extent size (pages) = 32

Prefetch size (pages) = 32

Number of containers = 1

Tablespace ID = 2

Name = USERSPACE1

Type = System managed space

Contents = Any data

State = 0x0004 这个代码意义就是“停顿的独占”,正常状态为0x0000,

非0就是有问题,都可以用下面方法解决。

Detailed explanation:

Quiesced: EXCLUSIVE

Total pages = 687

Useable pages = 687

Used pages = 687

Free pages = Not applicable

High water mark (pages) = Not applicable

Page size (bytes) = 4096

Extent size (pages) = 32

Prefetch size (pages) = 32

Number of containers = 1

Number of quiescers = 1 注意下面几行

Quiescer 1:

Tablespace ID = 2

Object ID = 50 “object id是造成死锁表的id”

◆2、db2 => select tabname from syscat.tables where tableid=50 通过所住的id号找出是哪个表。

TABNAME

--------------------------------------------

SYSINDEXEXTENSIONPARMS

TEST 就是这个表

2 record(s) selected.

◆3、db2 => quiesce tablespaces for table test reset 执行该命令清除错误的状态

DB20000I The QUIESCE TABLESPACES command completed successfully.

◆4、重新select,问题解决

◆5、比较常见导致改种问题的原因是,非正常的中止正对表进行的操作,导致对表空间的使用没有正常的释放。