######### restore数据库后一个表空间restore pending
目的是用生产机全备份再别的机器恢复,测试下在新存储上恢复时间
使用在线全备份进行数据库恢复,根据生产机裸设备情况,完全模拟生产机环境,
建立相同名称大小lv,进行restore,未进行重定向恢复

db2 restore后表空间处于restore pending,storage may be defined,storage must be defined状态
尝试用全备份恢复该表空间,报错如下:

MESSAGE : SQL2549N  The database was not restored because either all of the 
          table spaces in the backup image are inaccessible, or one or more 
          table space names in list of table space names to restore are 
          invalid.

删除lv重建无效

后尝试使用全备份,使用syscatspace,hdquery表空间rebuild数据库,该表空间仍处于restore pending,storage may be defined,storage must be defined状态

最后重定向恢复,set container环节报错如下


SET TABLESPACE CONTAINERS FOR 7 USING ( DEVICE '/dev/rhdqre1'                                                  2162688 , DEVICE '/dev/rhdqre2'                                                  2162688 , DEVICE '/dev/rhdqre3'                                                  2162688 , DEVICE '/dev/rhdqre4'                                                  2162688 )
SQL0299N  Container is already assigned to the table space.  SQLSTATE=42731

执行db2untag -f /dev/rhdqre*操作,去掉容器上表空间标识
问题解决

PS:之前做过重定向操作,缩小HD_QUERY表空间,但是之前忘了看高水位,导致页数低于高水位,restore一直在执行,但无进度,于是强制重启数据库,drop database重新recreate
可能是此操作导致容器上表空间信息未删除
之前走了很多弯路,知识不够完善啊。。
 
############online backup不管加不加include logs都有日志在里面?
在V97版本之后,online backup . 9.7 include logs是默认了
v97还有这个细节,不过为了安全起见,还是建议显式的加上include logs
 
在线备份需要日志是归档的,恢复的时候是需要日志的。。
不加include logs, 你需要去找哪些日志是恢复的时候需要的,然后弄出来,传输到恢复的地方。
也就是说,不加的话,你弄日志会很麻烦的。。
加了include logs,数据库备份的时候会把需要的日志一起打包到备份文件中,不需要你单独去管理日志。
V9.5:
INCLUDE LOGS
Specifies that the backup image should include the range of log files required to restore and roll forward this image to some consistent point in time. This option is not valid for an offline backup, with the exception of snapshot backups. Logs are included by default in the following backup scenarios:
Online backup of a single-partitioned database
Online single system view (SSV) backup of a multi-partitioned database
Online or offline snapshot backup

V9.7:
INCLUDE LOGS
Specifies that the backup image should include the range of log files required to restore and roll forward this image to some consistent point in time. This option is not valid for an offline backup, with the exception of snapshot backups. INCLUDE LOGS is always the default option for any online backup operation, except a multi-partitioned online backup where each database partition is backed up independently (that is, a non-single system view backup).
 
 
 
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值