[急]DB2 V9.5 on Linux 利用 数据库TEST01 的全备份 建立 TEST02 数据库时 出错

[复制链接]
查看11 | 回复9 | 2008-7-27 22:25:20 | 显示全部楼层 |阅读模式
步骤如下:
1、全备份 TEST01
BACKUP DB TEST01
2、利用 RESTORE ... INTO ... 建立 TEST02 数据库
RESTORE DB TEST01 INTO TEST02 WITHOUT ROLLING FORWARD WITHOUT PROMPTING
报错如下:
db2 => backup db test01
Backup successful. The timestamp for this backup image is : 20081027133930
db2 => restore db test01 into test02 without rolling forward without prompting
SQL2563WThe restore process has completed successfully, but one or more
table spaces from the backup were not restored.
db2 =>

db2diag.log 如下
回复

使用道具 举报

千问 | 2008-7-27 22:25:20 | 显示全部楼层
我注意到 db2diag.log 中有这么一段:

2008-10-27-13.39.55.249129+480 I7425348G544 LEVEL: Error
PID : 6797
TID: 2497702816PROC : db2sysc
INSTANCE: db2inst1
NODE : 000
EDUID : 909
EDUNAME: db2bm.638.0 (TEST02)
FUNCTION: DB2 UDB, buffer pool services, sqlbSMSAcquireContainer, probe:818
MESSAGE : ZRC=0x80020039=-2147352519=SQLB_CONTAINER_IN_USE

"Container is already being used"
DATA #1 :
Error acquiring container 0 (/db2home/db2inst1/db2inst1/NODE0000/TEST01/T0000003) for tbsp 3. Rc = 80020039.
2008-10-27-13.39.55.249222+480 I7425893G414 LEVEL: Error
PID : 6797
TID: 2497702816PROC : db2sysc
INSTANCE: db2inst1
NODE : 000
EDUID : 909
EDUNAME: db2bm.638.0 (TEST02)
FUNCTION: DB2 UDB, buffer pool services, sqlbSMSAddContainersToNewPool, probe:2
MESSAGE : ZRC=0x80020039=-2147352519=SQLB_CONTAINER_IN_USE

"Container is already being used"

估计在 RESTORE DB TEST01 INTO TEST02 WITHOUT ROLLING FORWARD WITHOUT PROMPTING
过程中,欲将 TEST02 的表空间 放置在 /db2home/db2inst1/db2inst1/NODE0000/TEST01/ 下
而不是 (/db2home/db2inst1/db2inst1/NODE0000/TEST02/
[ 本帖最后由 zhangzongjun 于 2008-10-27 14:25 编辑 ]
回复

使用道具 举报

千问 | 2008-7-27 22:25:20 | 显示全部楼层
我以前也遇到过类似那样的一个问题,恢复后是删除暂挂。我的问题是那个盘的空间不够大而导致的,不知道你的会不会有这个问题。。。。
回复

使用道具 举报

千问 | 2008-7-27 22:25:20 | 显示全部楼层
db2 => restore db test01 on /db2home/db2inst1 into test02 without rolling forward without prompting
SQL2563WThe restore process has completed successfully, but one or more
table spaces from the backup were not restored.
db2 =>
db2 =>
db2 => drop db test02
DB20000IThe DROP DATABASE command completed successfully.
db2 =>
db2 =>
db2 =>
db2 => restore db test01 REBUILD WITH ALL TABLESPACES IN DATABASEinto test02 without rolling forward without prompting
SQL2563WThe restore process has completed successfully, but one or more
table spaces from the backup were not restored.
db2 => drop db test02
DB20000IThe DROP DATABASE command completed successfully.
db2 =>
db2 =>
db2 =>
db2 => restore db test01 REBUILD WITH ALL TABLESPACES IN IMAGE into test02 without rolling forward without prompting
SQL2563WThe restore process has completed successfully, but one or more
table spaces from the backup were not restored.
db2 =>
[ 本帖最后由 zhangzongjun 于 2008-10-27 14:30 编辑 ]
回复

使用道具 举报

千问 | 2008-7-27 22:25:20 | 显示全部楼层
[db2inst1@sanwa52 NODE0000]$ pwd
/db2home/db2inst1/db2inst1/NODE0000
[db2inst1@sanwa52 NODE0000]$ ll
total 88
drwx------5 db2inst1 db2grp 4096 Oct 27 13:27 IKS
drwxr-x---4 db2inst1 db2grp 4096 Oct 27 12:43 SQL00001
drwxr-x---9 db2inst1 db2grp 4096 Oct 25 15:35 SQL00002
drwxr-x---4 db2inst1 db2grp 4096 Oct 27 12:54 SQL00003
drwxr-x---4 db2inst1 db2grp 4096 Oct 27 13:34 SQL00004
drwxr-x---4 db2inst1 db2grp 4096 Oct 27 14:08 SQL00005
drwxrwxr-x2 db2inst1 db2grp 4096 Oct 27 14:08 sqldbdir
drwx------5 db2inst1 db2grp 4096 Oct 27 12:53 TEST
drwx------7 db2inst1 db2grp 4096 Oct 27 13:54 TEST01
drwx------5 db2inst1 db2grp 4096 Oct 27 14:08 TEST02
drwx------8 db2inst1 db2grp 4096 Oct 27 13:04 UTF8DB
[db2inst1@sanwa52 NODE0000]$
[db2inst1@sanwa52 NODE0000]$ ls -l TEST01/
total 40
drwx------2 db2inst1 db2grp 4096 Oct 27 13:34 T0000000
drwx------3 db2inst1 db2grp 4096 Oct 27 13:54 T0000001
drwx------2 db2inst1 db2grp 4096 Oct 27 13:38 T0000002
drwx------2 db2inst1 db2grp 4096 Oct 27 13:37 T0000003
drwx------3 db2inst1 db2grp 4096 Oct 27 13:54 T0000004
[db2inst1@sanwa52 NODE0000]$ ls -l TEST02/
total 24
drwx------2 db2inst1 db2grp 4096 Oct 27 14:08 T0000000
drwx------3 db2inst1 db2grp 4096 Oct 27 14:08 T0000001
drwx------3 db2inst1 db2grp 4096 Oct 27 14:08 T0000004
[db2inst1@sanwa52 NODE0000]$
[ 本帖最后由 zhangzongjun 于 2008-10-27 14:29 编辑 ]
回复

使用道具 举报

千问 | 2008-7-27 22:25:20 | 显示全部楼层
你在同一台机器恢复,要用重定向恢复才行
回复

使用道具 举报

千问 | 2008-7-27 22:25:20 | 显示全部楼层
原帖由 jayciedede 于 2008-10-27 14:45 发表
你在同一台机器恢复,要用重定向恢复才行

是的,
只是 在 V8 的版本下,我这样恢复是不需要重定向的。
没想到 在 V9.5 的版本下,竟然需要。
主要是V9 数据库存放的路径中,默认 有 DBNAME ,很可能这就是导致 RESTORE INTO 的错误
回复

使用道具 举报

千问 | 2008-7-27 22:25:20 | 显示全部楼层
如果是做测试,那么把test1 drop了呢?
回复

使用道具 举报

千问 | 2008-7-27 22:25:20 | 显示全部楼层
我做了进一步的测试,
如果在 DB2 V9.5 下,数据库的目录 都在一个 父目录下,
而不是分别的存放在 2个目录下,
就不需要使用 重定向 恢复,直接 RESTORE 就没有问题
回复

使用道具 举报

千问 | 2008-7-27 22:25:20 | 显示全部楼层
学习了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行