程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> SqlServer數據庫 >> 關於SqlServer >> SQL0290N表空間狀態獨占處理問題

SQL0290N表空間狀態獨占處理問題

編輯:關於SqlServer


今天一個同事報告一個問題,表都不能使用了,檢查了一下,發現問題 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、比較常見導致改種問題的原因是,非正常的中止正對表進行的操作,導致對表空間的使用沒有正常的釋放。

 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved