两种DB2分区数据库恢复方式

数据库
DB2分区数据库恢复分为两种方法,即串行和并行的方式。下文对这两种方式作了详细的介绍,如果您对此方面感兴趣的话,不妨一看。

DB2分区数据库恢复分为·分区间串行方式和分区间并行方式。下面就为您详细介绍这两种DB2分区数据库恢复方式,供您参考学习。

分区数据库的恢复操作:

由于备份和恢复操作都只作用于当前数据库分区,因此也可分为串行和并行的方式。为了在前滚恢复中介绍OVERFLOW 选项的使用,这里我们将 SAMPLE 数据库恢复到同实例的一个名为SAMPNEW的新数据库中,其命令应为:

·DB2分区数据库恢复--分区间串行方式:

  1. db2_all "db2 restore db sample into sampnew without prompting" 

注:由于是分区数据库,因此在完成了***个分区的恢复操作,开始第二个分区的恢复操作时系统会出现SQL2529W的警告,表明数据库已存在,是否要覆盖数据恢复的提示,而在某些平台下,如Linux,这一提示会导致分区数据库恢复操作的失败,如:

$ db2_all "db2 restore db sample into sapmnew"

DB20000I The RESTORE DATABASE command completed successfully.
rhas3: db2 restore db sample into sapmnew completed ok

SQL2529W Warning! Restoring to an existing database that is different from the backup image database, and the alias name "SAPMNEW" of the existing database do es not match the alias name "SAMPLE" of the backup image, and the database name "SAPMNEW" of the existing database does not match the database name "SAMPLE" of the backup image. The target database will be overwritten by the backup version. The Roll-forward recovery logs associated with the target database will be deleted.
Do you want to continue ? (y/n) SQL2001N The utility was interrupted. The output data may be incomplete.
rhas3: db2 restore db sample into sapmnew completed rc=4

因此建议在上述硬盘数据恢复命令中加入了“WITHOUT PROMPTING”的选项,以避免该提示的出现。

DB2分区数据库恢复--分区间并行方式

  1. db2_all "<<+0< db2 restore db sample into sampnew"  
  2. db2_all "||<<-0< db2 restore db sample into sampnew without prompting" 

  1. db2_all "<<-0<; db2 restore db sample into sampnew without prompting" 

因编目分区是***个进行恢复的分区,所以无需加“WITHOUT PROMPTING”选项。

由于我们使用的备份映象文件是通过联机备份产生的,因此在恢复操作结束后,数据库将处于前滚暂挂状态,必须通过前滚操作前滚归档日志,以取消前滚暂挂状态,使数据库最终可用。

 

 

 

【编辑推荐】

三类DB2数据库备份方案

DB2批量执行SQL脚本的实现

在线改变DB2页大小的实现

windows下创建DB2表空间的过程

DB2字符串连接的实现过程

 

责任编辑:段燃 来源: 互联网
相关推荐

2010-08-31 10:38:30

DB2恢复分区

2010-11-02 10:35:59

DB2分区数据库

2010-11-02 10:16:22

DB2分区数据库备份

2010-08-18 11:17:29

DB2分区数据库DB2

2010-08-31 17:14:24

DB2表空间

2010-11-04 10:16:38

db2日志保存

2010-08-26 15:15:18

DB2备份

2011-03-03 14:52:40

DB2数据库恢复

2010-07-27 14:33:24

DB2数据库

2010-08-17 09:48:40

DB2 分区数据库

2010-08-03 14:40:05

DB2数据库

2010-11-04 10:09:23

DB2存储过程

2010-08-02 13:52:04

DB2数据库

2010-08-12 11:38:21

DB2数据库

2010-08-12 10:54:21

IBM DB2数据库

2010-11-29 09:56:00

sybase数据库备份

2010-08-03 11:27:01

DB2分区兼容性

2010-08-25 14:12:47

DB2备份恢复

2009-03-25 17:43:09

备份DB2IBM

2010-08-25 10:16:48

DB2备份Linux
点赞
收藏

51CTO技术栈公众号