备份恢复数据库

db2cmd

db2stop force
db2start

快速执行下面的命令

db2 backup db BPEDB to C:\db(数据库的名字)

db2 restore db BPEDB from C:\issues\1.4\dbbackup13(目录名)

db2 -tf c:\xx.sql ( 执行sql文件)

SQL1117N 由于 ROLL-FORWARD PENDING,不能连接或激活数据库

1. 我修改参数:
db2 update db cfg for sample using LOGRETAIN ON
2. force applications all
3. db2stop
4. db2start
5. db2 backup db sample to c:\tmp
6. insert data into table test
7. db2 backup db sample online to c:\tmp\db2
8. insert data into table test
9. db2 force applications all
10. db2stop
11. db2start
12. db2 restore db sample from c:\tmp\db2
13. db2 rollforward db sample to end of logs and stop
14. db2 delete from test
15. db2 force applications all
16. db2stop
17. db2start
18. db2 restore db sample from c:\tmp\db2
19. db2 rollforward db sample to end of logs and stop

你可能感兴趣的:(DB2)