1、在线备份表空间
backup database test tablespace(TBS_CMS_DAT) online to /home/db2inst1/backup
时间戳记:20151021161045
2、查看系统当前时间戳:
db2 "select current timestamp from sysibm.sysdummy1"
1
--------------------------
2015-10-21-16.12.52.959919
1 record(s) selected.
3、删除一些数据
4、恢复表空间
connect to test
Database Connection Information
Database server = DB2/LINUXX8664 10.5.3
SQL authorization ID = DB2INST1
Local database alias = TEST
restore database test tablespace(TBS_CMS_DAT) online from /home/db2inst1/backup
taken at 20151021161045
5、查看表空间状态
rollforward database test query status tablespace(TBS_CMS_DAT)
SQL1035N The operation failed because the specified database cannot be connected to in the mode requested. SQLSTATE=57019
6、前滚到制定时间戳位置:(时间必须比系统当前时间戳大或者等于)
rollforward database test to 2015-10-19-16.08.32 using local time and stop tablespace(TBS_CMS_DAT)
SQL1035N The operation failed because the specified database cannot be connected to in the mode requested. SQLSTATE=57019
Tablespace ID = 4
Name = TBS_CMS_DAT
Type = Database managed space
Contents = All permanent data. Large table space.
State = 0x0080
Detailed explanation:
Roll forward pending
收起