上一篇揭示 QUIESCE RESET 必須由原發起授權 ID 執行才生效。本文提供標準化排查與重置流程:停止實例 → db2dart /DTSF 產生報告 → 解析 Userid of quiescer → 以正確授權 ID 登入執行 RESET → 驗證狀態恢復 0x0000。
db2stop force
db2dart 需獨佔存取資料庫檔案,實例必須停止。
db2dart <資料庫別名> /DTSF
# 範例:db2dart SAMPLE /DTSF
/DTSF (Dump TableSpace Quiescer Info):專門傾印表空間靜默資訊<DB2INSTPROF>/dump/DART0000/<資料庫名>.RPT打開報告檔,搜尋靜默表空間 ID (如 Tablespace ID: 2):
Information for Tablespace ID: 2
-------------------------------------
Tablespace name: USERSPACE1
Table space flags (HEX): 0101
Table space type: System Managed Space (SMS)
Page size: 4096
Extent size: 32
Prefetch size: 32
Version: 9
Tablespace state: 2
Number of quiescers: 1
1) Userid of quiescer: DB2INST1
Quiesce state: 2
Tbspace ID of quiesced object: 2
Table ID of quiesced object: 3
EDU ID: 0
Agent ID: 0
關鍵欄位:Userid of quiescer: DB2INST1 → 此為唯一能成功 RESET 的授權 ID。
# 重啟實例
db2start
# 以 DB2INST1 登入 (或具相同授權 ID 的用戶)
db2 connect to SAMPLE user db2inst1 using password
# 執行重置
db2 quiesce tablespaces for table db2inst1.staff reset
# DB20000I The QUIESCE TABLESPACES command completed successfully.
db2 list tablespaces
# 輸出片段:
Tablespace ID = 2
Name = USERSPACE1
Type = System managed space
Contents = Any data
State = 0x0000
Detailed explanation:
Normal
State = 0x0000 確認靜默已完全解除,表空間恢復正常存取。
QUIESCE RESET 時,語法檢查通過即回傳成功若無法停止實例執行 db2dart,可嘗試:
SELECT TBSP_NAME, QUIESCER_AUTHID, QUIESCE_STATE
FROM SYSIBMADM.TBSP_UTILIZATION
WHERE TBSP_STATE != 0;db2pd -tablespaces -db <dbname> | grep -A5 "Quiescer"db2 get snapshot for applications on <dbname> | grep -i quiesce注意:線上方法可能無法顯示已斷開連線的靜默持有者,db2dart /DTSF 為最權威離線分析手段。
#!/bin/bash
# backup_with_quiesce.sh
DB=SAMPLE
TABLE=db2inst1.staff
db2 "quiesce tablespaces for table $TABLE intent to update"
if [ $? -ne 0 ]; then exit 1; fi
# 執行備份
db2 "backup database $DB online"
RC=$?
# 無論備份成敗,嘗試重置
db2 "quiesce tablespaces for table $TABLE reset"
exit $RC
db2 force application all 清理所有連線db2stop force && db2start (會清除記憶體中靜默狀態)0x0000db2stop forcedb2dart <db> /DTSFUserid of quiescerdb2start 並以該授權 ID 登入QUIESCE RESETdb2 list tablespaces 驗證 State = 0x0000