วันพุธที่ ๑ ธันวาคม พ.ศ. ๒๕๕๓

General SQL error : SQL0290N Table space access is not allowed. SQLSTATE=55039

เกิดปัญหาในระบบงานศูนย์บริการขึ้น โดยที่เมื่อ "บันทึก" ข้อมูลจะขึ้น Error (ตามรูปที่ 1)

"General SQL error.
[IBM][CLI Driver][DB2/NT] SQL0290N Table space access is
not allowed. SQLSTATE=55039"

รูปที่ 1


และเมื่อเข้าไปดูที่ Control Center -> Table Spaces พบว่า
Table Spaces ชื่อ USERSPACE1 มี State เป็น "Quiesced Share"

ซึ่ง Table Spaces ตัวอื่นจะเป็น Normal (ตามรูปที่ 2)


รูปที่ 2
---------------------------
SQL0290N
Table space access is not allowed.
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=/com.ibm.db2.luw.messages.sql.doc/doc/msql00290n.html



สำ ห รั บ วิ ธี แ ก้ ไ ข มี ดั ง นี้
==================

( Users : db2admin )
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/core/r0002003.htm

QUIESCE TABLESPACES FOR TABLE Command

Quiesces table spaces for a table. There are three valid quiesce modes: share, intent to update, and exclusive. There are three possible states resulting from the quiesce function: QUIESCED SHARE, QUIESCED UPDATE, and QUIESCED EXCLUSIVE.


Command syntax

>>-QUIESCE TABLESPACES FOR TABLE--+-tablename--------+----------> '-schema.tablename-'
>--+-SHARE------------+---------------------------------------->< +-INTENT TO UPDATE-+ +-EXCLUSIVE--------+ '-RESET------------'
Example
------------
"db2 quiesce tablespaces for table staff
share"
"db2 quiesce tablespaces for table boss.org
intent to update"
"db2 quiesce tablespaces for table mytable exclusive"
To remove a phantom quiesce:

1. Connect to the database with the same user ID used when the quiesce mode was set.
2. Use the LIST TABLESPACES command to determine which table space is quiesced.
3. Re-quiesce the table space using the current quiesce state. For example: db2 quiesce tablespaces for table mytable exclusive
การหา่ว่า Table ไหนที่ติด State "Quiesced"
------------------------------------------------------------------
"DB2 LIST TABLESPACES SHOW DETAIL"
Number of quiescers = 1
Quiescer 1:
Tablespace ID = 2
Object ID = 3
การหา Object ID ( TableID )
--------------------------------
SYSCAT.TABLES catalog view
Column : TABLEID = Object ID
=> TABNAME = ชื่อ Table
< - - - - To experience success .. good luck - - - - >