guoyanxi 发表于 2013-1-25 21:45:24

restore database from online backup

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 LogBackup ID -- --- ------------------ ---- --- ------------ ------------ --------------BD20101208120448001   F    DS0000000.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 LogBackup ID -- --- ------------------ ---- --- ------------ ------------ --------------BD20101210132310001   N    DS0000007.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 allDB20000IThe FORCE APPLICATION command completed successfully.DB21024IThis command is asynchronous and may not be effective immediately.db2 => db2 => db2 => db2 => db2 => restore db sample from /arch/      SQL2522NMore than one backup file matches the timestamp value provided for the backed up database image.db2 => restore db sample from /arch/ taken at 20101210132310SQL2539WWarning!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) yDB20000IThe RESTORE DATABASE command completed successfully.db2 => $ db2 connect to sampleSQL1117NA 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 UTCDB20000IThe ROLLFORWARD command completed successfully.$ db2 connect to sample   Database Connection Information Database server      = DB2/LINUX 9.7.1 SQL authorization ID   = DB2INST1 Local database alias   = SAMPLE
页: [1]
查看完整版本: restore database from online backup