IBM Support

如何恢复损坏的临时表空间?

Question & Answer


Question

临时表空间状态0x4000 表明是offline表空间 You have a temporary tablespace with state 0x4000 indicates it is an offline tablesapce: Tablespace ID = 1 Name = TEMPSPACE1 Type = System managed space Contents = System Temporary data State = 0x4000 Detailed explanation: Offline

Cause

诊断信息可以看到如下报错信息:


至少一个文件(SQLTAG.NAM) 从容器路径中被意外删除

> cd E:\DB2\NODE0000\SAMPLE\T0000001\C0000000.TMP
> dir
total 0
-rwx------ 1 Administ 42949672 0 Mar 10 01:32 SQL00002.TDA

Answer

由于是临时表空间,我们可以通过以下方式删除并重建。

首先通过命令 "db2pd -d <db name> -tablespace" 查看表空间的配置情况


由于TEMPSPACE1 是唯一一个系统管理的表空间,在删除之前需要建另外一个

db2 connect to SAMPLE


db2 "create system temporary tablespace TEMPSPACE2 pagesize 16k"

删除和重建 TEMPSPACE1:
db2 "drop tablespace TEMPSPACE1"
db2 "create system temporary tablespace TEMPSPACE1 pagesize 16k"

删除临时表空间TEMPSPACE2:
db2 "drop tablespace TEMPSPACE2"

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Recovery - Crash Recovery","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.8;9.7;10.1;10.5;11.1","Edition":"Advanced Enterprise Server;Advanced Workgroup Server;Enterprise Server;Express;Express-C;Personal;Workgroup Server","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg22003383