restore database from online backup



db2 => list history backup all for db sample

List History File for sample

Number 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: /arch

db2 =>
db2 => force application all
DB20000I 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 20101210132310
SQL2539W 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) y
DB20000I The RESTORE DATABASE command completed successfully.
db2 =>
[db2inst1@localhost ~]$ db2 connect to sample
SQL1117N 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 UTC

DB20000I 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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值