六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 59|回复: 0

restore database from online backup

[复制链接]

升级  35%

89

主题

89

主题

89

主题

举人

Rank: 3Rank: 3

积分
305
 楼主| 发表于 2013-1-13 18:23:13 | 显示全部楼层 |阅读模式
db2 => list history backup all for db sample                    List History File for sampleNumber of matching file entries = 2 Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID -- --- ------------------ ---- --- ------------ ------------ --------------  B  D  20101208120448001   F    D  S0000000.LOG S0000000.LOG   ----------------------------------------------------------------------------  Contains 5 tablespace(s):  00001 SYSCATSPACE                                                             00002 USERSPACE1                                                              00003 IBMDB2SAMPLEREL                                                         00004 IBMDB2SAMPLEXML                                                         00005 SYSTOOLSPACE                                                           ----------------------------------------------------------------------------    Comment: DB2 BACKUP SAMPLE OFFLINE                                         Start Time: 20101208120448   End Time: 20101208120459     Status: A ----------------------------------------------------------------------------  EID: 4 Location: /arch Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID -- --- ------------------ ---- --- ------------ ------------ --------------  B  D  20101210132310001   N    D  S0000007.LOG S0000007.LOG   ----------------------------------------------------------------------------  Contains 7 tablespace(s):  00001 SYSCATSPACE                                                             00002 USERSPACE1                                                              00003 IBMDB2SAMPLEREL                                                         00004 IBMDB2SAMPLEXML                                                         00005 SYSTOOLSPACE                                                            00006 TBS00                                                                   00007 TBS02                                                                  ----------------------------------------------------------------------------    Comment: DB2 BACKUP SAMPLE ONLINE                                          Start Time: 20101210132310   End Time: 20101210132323     Status: A ----------------------------------------------------------------------------  EID: 19 Location: /archdb2 => db2 => force application allDB20000I  The FORCE APPLICATION command completed successfully.DB21024I  This command is asynchronous and may not be effective immediately.db2 => db2 => db2 => db2 => db2 => restore db sample from /arch/      SQL2522N  More than one backup file matches the timestamp value provided for the backed up database image.db2 => restore db sample from /arch/ taken at 20101210132310SQL2539W  Warning!  Restoring to an existing database that is the same as the backup image database.  The database files will be deleted.Do you want to continue ? (y/n) yDB20000I  The RESTORE DATABASE command completed successfully.db2 => [db2inst1@localhost ~]$ db2 connect to sampleSQL1117N  A connection to or activation of database "SAMPLE" cannot be made because of ROLL-FORWARD PENDING.  SQLSTATE=57019--这个时候数据库是处于ROLL-FORWARD 的状态的db2 => rollforward db sample to end of logs and complete                                    Rollforward Status Input database alias                   = sample Number of nodes have returned status   = 1 Node number                            = 0 Rollforward status                     = not pending Next log file to be read               = Log files processed                    = S0000007.LOG - S0000007.LOG Last committed transaction             = 2010-12-10-05.23.22.000000 UTCDB20000I  The ROLLFORWARD command completed successfully.[db2inst1@localhost ~]$ db2 connect to sample   Database Connection Information Database server        = DB2/LINUX 9.7.1 SQL authorization ID   = DB2INST1 Local database alias   = SAMPLE
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表