DB2数据库恢复出现问题 表空间Restore pending Storage may be defined
$ db2 -tvf restore_iesxhls.sql
RESTORE DATABASE IESXH FROM /dbback TAKEN AT 20091113113945 TO /rptdb/iesxhls_sp
ace WITH 2 BUFFERS BUFFER 1024 REDIRECT WITHOUT ROLLING FORWARD WITHOUT PROMPTI
NG
SQL1277W A redirected restore operation is being performed. Table space
configuration can now be viewed and table spaces that do not use automatic
storage can have their containers reconfigured.
DB20000I The RESTORE DATABASE command completed successfully.
SET TABLESPACE CONTAINERS FOR 0 IGNORE ROLLFORWARD CONTAINER OPERATIONS USING (P
ATH '/rptdb/iesxhls_space/SYSCATSPACE')
DB20000I The SET TABLESPACE CONTAINERS command completed successfully.
SET TABLESPACE CONTAINERS FOR 1 IGNORE ROLLFORWARD CONTAINER OPERATIONS USING (P
ATH '/rptdb/iesxhls_space/TEMPSPACE1')
DB20000I The SET TABLESPACE CONTAINERS command completed successfully.
SET TABLESPACE CONTAINERS FOR 2 IGNORE ROLLFORWARD CONTAINER OPERATIONS USING (P
ATH '/rptdb/iesxhls_space/USERSPACE1')
DB20000I The SET TABLESPACE CONTAINERS command completed successfully.
SET TABLESPACE CONTAINERS FOR 3 IGNORE ROLLFORWARD CONTAINER OPERATIONS USING (P
ATH /rptdb/iesxhls_space/TOOLTB)
DB20000I The SET TABLESPACE CONTAINERS command completed successfully.
SET TABLESPACE CONTAINERS FOR 4 IGNORE ROLLFORWARD CONTAINER OPERATIONS USING (P
ATH /rptdb/iesxhls_space/SYSTOOLSTMPSPACE)
DB20000I The SET TABLESPACE CONTAINERS command completed successfully.
SET TABLESPACE CONTAINERS FOR 6 IGNORE ROLLFORWARD CONTAINER OPERATIONS USING (F
ILE /rptdb/iesxhls_space/DATA_2 100000)
DB20000I The SET TABLESPACE CONTAINERS command completed successfully.
SET TABLESPACE CONTAINERS FOR 7 IGNORE ROLLFORWARD CONTAINER OPERATIONS USING (F
ILE '/rptdb/iesxhls_space/rsale1' 1000000, FILE '/rptdb/iesxhls_space/rsale2' 10
00000,FILE '/rptdb/iesxhls_space/rsale3' 1000000)
DB20000I The SET TABLESPACE CONTAINERS command completed successfully.
SET TABLESPACE CONTAINERS FOR 8 IGNORE ROLLFORWARD CONTAINER OPERATIONS USING (P
ATH /rptdb/iesxhls_space/TB8)
DB20000I The SET TABLESPACE CONTAINERS command completed successfully.
RESTORE DATABASE IESXH CONTINUE
SQL1277W A redirected restore operation is being performed. Table space
configuration can now be viewed and table spaces that do not use automatic
storage can have their containers reconfigured.
DB20000I The RESTORE DATABASE command completed successfully.
$ db2 list tablespaces
Tablespaces for Current Database
Tablespace ID = 0
Name = SYSCATSPACE
Type = System managed space
Contents = All permanent data. Regular table space.
State = 0x2000100
Detailed explanation:
Restore pending
Storage may be defined
Tablespace ID = 1
Name = TEMPSPACE1
Type = System managed space
Contents = System Temporary data
State = 0x2000100
Detailed explanation:
Restore pending
Storage may be defined
Tablespace ID = 2
Name = USERSPACE1
Type = System managed space
Contents = All permanent data. Regular table space.
State = 0x2000100
Detailed explanation:
Restore pending
Storage may be defined
Tablespace ID = 3
Name = TOOLTB
Type = System managed space
Contents = All permanent data. Regular table space.
State = 0x2000100
Detailed explanation:
Restore pending
Storage may be defined
Tablespace ID = 4
Name = SYSTOOLSTMPSPACE
Type = System managed space
Contents = User Temporary data
State = 0x2000100
Detailed explanation:
Restore pending
Storage may be defined
Tablespace ID = 6
Name = DATA_2
Type = Database managed space
Contents = All permanent data. Regular table space.
State = 0x2000100
Detailed explanation:
Restore pending
Storage may be defined
Tablespace ID = 7
Name = RPT
Type = Database managed space
Contents = All permanent data. Regular table space.
State = 0x2000100
Detailed explanation:
Restore pending
Storage may be defined
Tablespace ID = 8
Name = TEMPSPACE32
Type = System managed space
Contents = System Temporary data
State = 0x2000100
Detailed explanation:
Restore pending
Storage may be defined
$ db2 connect to iesxh
SQL0752N Connecting to a database is not permitted within a logical unit of
work when the CONNECT type 1 setting is in use.
[解决办法]
你先创建一个空库然后restore到这个空库上试试看
[解决办法]
http://www.ibm.com/developerworks/cn/data/library/techarticles/dm-0407melnyk/index.html#smbd
在执行了重定向恢复操作的第一部分之后(即在发出 SET TABLESPACE CONTAINERS 命令之前),数据库的表空间就处于这种状态。如果您愿意,这将允许您重新定义容器
backup db sample;
假定该备份映像的时间戳为:20040613204955
restore db sample taken at 20040613204955 redirect;
list tablespaces;
Information returned by the LIST TABLESPACES 命令返回的信息显示,所有的表空间都处于 Storage May be Defined
处理的方法就是楼上说的,建个新库,然后restore